injectActivityViewModels
inline fun <VM : ViewModel> Fragment.injectActivityViewModels(qualifier: Any? = null, noinline extrasProducer: () -> CreationExtras? = null): Lazy<VM>
Deprecated
Renamed to lazyActivityViewModels.
Replace with
this.lazyActivityViewModels(qualifier, extrasProducer)
Content copied to clipboard
Returns a Lazy delegate to access parent activity's ViewModel provided by Koject
class TopFragment : Fragment() {
private val viewModel: TopViewModel by injectActivityViewModels()
}
Content copied to clipboard
Parameters
qualifier
Qualifier for identification.
extrasProducer
Create the default extras that will be used to create the ViewModel.