Answer the question
In order to leave comments, you need to log in
Why does the constructor fire every time the ViewModel is connected?
Either I missed something, or ...
I decided to try, I created the class SharedModel extends ViewModel
Inside a couple of livdata fields and a few simple ones, like
private int mGameMode;
private int mGameLevel;
mSharedModel = new ViewModelProvider(this).get(SharedModel.class);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question