Hi everybody Is there a way to do something like t...
# android
c
Hi everybody Is there a way to do something like this? am trying to have a generic viewModel in all my fragment
r
Your trying to do reflection without reflection lol . To do what your trying to do , you would have to request more information about the viewmodel class .. like creating a abstract fun viewModelClass(): Class<T>
than you can do model = ViewModelProviders.of(activity).get(viewModelClass())
c
get it Thank