Top "Android-viewmodel" questions

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

Failed to resolve: androidx.lifecycle:lifecycle-extensions-ktx:2.0.0-alpha1

I am trying to understand ViewModel and LiveData concepts in android. I am making a practice project but when i …

android kotlin android-architecture-components android-viewmodel android-livedata
Should I include LifecycleOwner in ViewModel?

LifecycleOwner is currently needed in order for me to create an observer. I have code which creates an Observer in …

android mvvm android-viewmodel
How to implement validation using ViewModel and Databinding?

What is the best approach to validate form data using ViewModel and Databinding? I have a simple Sign-Up activity that …

android validation kotlin android-databinding android-viewmodel
Updating UI using ViewModel and DataBinding

I am trying learn View-model android ,in my first phase of learning i am trying to update UI (Textview) by …

android-databinding android-architecture-components android-viewmodel android-livedata
Caused by: org.koin.core.error.InstanceCreationException: Could not create instance for [type:Factory,primary_type

I am developing news app I have implemented koin with viewmodel in fragment class but I am getting following error …

android mvvm fragment android-viewmodel koin
How to use a ViewModelProvider.Factory when extends from AndroidViewModel

I want to send an extra parameter to my ViewModel, but this extends from AndroidViewModel. How can I add this …

android android-architecture-components android-viewmodel android-jetpack
Android ViewModel recreated on screen rotation

I found a case when architecture components ViewModel isn't retained - in short it goes as follows: Activity is started …

android android-architecture-components android-viewmodel
Is it correct to bind a ViewModel to a Service?

I've started using Architecture Components in my application and I'm still learning how to use it. In my app I …

android android-service android-architecture-components android-viewmodel
Cannot resolve symbol ViewModelProviders

I am working on Android ViewModel architecture component but I am getting the above mentioned error when trying to initialize …

android android-viewmodel
Use viewLifecycleOwner as the LifecycleOwner

I have a fragment: class MyFragment : BaseFragment() { // my StudentsViewModel instance lateinit var viewModel: StudentsViewModel override fun onCreateView(...){ ... } override fun onViewCreated(…

android android-fragments android-livedata android-viewmodel