Reputation: 90
How can I use android.arch.lifecycle.ViewModel
with leanback fragments? For example GuidedStepFragment
extends android.app.Fragment
which cannot be used in ViewModel instance creation via ViewModelProviders.of(fragment).get(viewModelClass)
because method ViewModelProviders.of
requires android.support.v4.app.Fragment
.
Am I something missing or ViewModel can't be used for leanback fragments?
Leanback developers, hello? Why are you extending android.app.Fragment
instead of android.support.v4.app.Fragment
?
Upvotes: 1
Views: 1048
Reputation: 628
There is GuidedStepSupportFragment
(extends android.support.v4.app.Fragment
) in leanback
starting from 27.1.0
Upvotes: 2