Top "Android-viewmodel" questions

The ViewModel class is designed to store and manage UI-related data in a lifecycle conscious way.

Does ViewModel survive Activity save and restore?

Instances of the new ViewModel class can survive configuration changes if used in the following fashion: mViewModel = ViewModelProviders.of(this).…

android viewmodel android-architecture-components android-viewmodel view-model-pattern
View models for RecyclerView items

My activity has a Google's ViewModel that fetches some model items. These items are then transformed into adapter items of …

android android-recyclerview android-architecture-components android-viewmodel
Setting up LiveData observer in custom view without LifecycleOwner

I'm trying out the new Android Architecture components and have run into a road block when trying to use the …

android mvvm android-architecture-components android-livedata android-viewmodel
How to read data and listen to changes from Room database in a Service?

i am storing user information in a local room database. In activities and fragments I use AndroidViewModel and LiveData to …

java android android-service android-room android-viewmodel
ViewPager with viewmodel and live data , all 6 tabs data is replaced by last tab data

I am working on a ViewPager with 6 tabs where it has only one fragment TimesListFragment Depending on the arguments passed …

android android-viewpager android-livedata android-viewmodel
Android: ViewModel. Failed to call observer method

I'm using new arch. components from google. I have in Activity Login/Registering Fragments that are managed thanks to FragmentTransaction …

android android-fragments android-lifecycle android-viewmodel
What is ViewModelStore and viewModelStoreOwner?

I am very confused due to this new ViewModelProvider api(ViewModelProviders is deprecated) As with the new changes there are …

android android-fragments android-activity android-viewmodel