You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to use queries with parameter I didn't find any solution so I tried to create another constructor for both view model class and repository class but I noticed that in CodeLab they don't use view model constructors at all and instead they use view model provider so I changed it and used this : new StoryViewModel(getApplication(),"Fiction"); instead of this: new ViewModelProvider(this).get(StoryViewModel.class);
I don't know if there's anything wrong with this or not. It works fine now, but if it's the way why didn't we use this always? and why do we use view model provider?
Can anyone explain?
Or help me with using queries with parameter.
Thank you.
The text was updated successfully, but these errors were encountered:
In order to use queries with parameter I didn't find any solution so I tried to create another constructor for both view model class and repository class but I noticed that in CodeLab they don't use view model constructors at all and instead they use view model provider so I changed it and used this :
new StoryViewModel(getApplication(),"Fiction");
instead of this:new ViewModelProvider(this).get(StoryViewModel.class);
I don't know if there's anything wrong with this or not. It works fine now, but if it's the way why didn't we use this always? and why do we use view model provider?
Can anyone explain?
Or help me with using queries with parameter.
Thank you.
The text was updated successfully, but these errors were encountered: