Category : viewmodel

I’m very new in kotlin and unit test case, I’m trying to write unit test case of ViewModel but it goes to be failed and gives below error code org.mockito.exceptions.misusing.WrongTypeOfReturnValue: SingleJust cannot be returned by getCountryDetails() getCountryDetails() should return Call *** If you’re unsure why you’re getting above error read on. Due to the nature ..

Read more

I would like to have an structure like the following one: CustomActiviy -> MyAppActivity -> AppCompatActivity CustomViewModel -> MyAppViewModel -> ViewModel (Android one) in order to have a couple of MutableLiveData objects in the MyAppViewModel (one related to showing toast messages and the other to switch a progress bar) and observe them in the MyAppActivity. ..

Read more

Can someone please help with this Hilt Dependency injection problem? Code is available here:: https://gist.github.com/nyxee/bfb2fd3b2a29d886479f5bc54d836e36 The error message I get is: error: cannot find symbol private final Provider<Class<T>> clazz; class ClubsViewModel<T> @ViewModelInject constructor(clazz: Class<T>) : BaseViewModel<T>(clazz) { listenToFireStoreCollection("Clubs", _mClubs) … } class BViewModel<T> @ViewModelInject constructor(clazz: Class<T>) : BaseViewModel<T>(clazz) { private var _mBs = MutableLiveData<List<T>>() listenToFireStoreCollection("Bname", ..

Read more