viewmodelproviders Questions

10

Solved

I am new to the mvvm pattern. I created a ViewModel for the main activity. Now I want to get an instance of the ViewModel in the main activity. Most Tutorials and answers here on Stackoverflow su...
Shaddock asked 28/1, 2020 at 16:3

3

Solved

Currently I update androidx.lifecycle:lifecycle-extensions version from 2.2.0-alpha01 to 2.2.0and it shows that ViewModelProviders is depricated. So what is the alternative way to use ViewModelProv...

3

Solved

Inside my Fragment I initialize a ViewModel using ViewModelProviders. I want it to take its Activity if not null, otherwise itself (Fragment). private val viewModel: MainViewModel by lazy { ViewM...
Neoplasty asked 15/10, 2018 at 7:27
1

© 2022 - 2024 — McMap. All rights reserved.