Hi everybody
Is there a way to do something like this?
am trying to have a generic viewModel in all my fragment
r
rkeazor
12/24/2018, 3:25 PM
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>
rkeazor
12/24/2018, 3:27 PM
than you can do model = ViewModelProviders.of(activity).get(viewModelClass())