kevinmost
11/21/2017, 6:20 PMabstract class ViewModelFragment {
protected lateinit var mViewModel: Any
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
mViewModel = ViewModelProviders
.of(scope)
.get(getGenericTClass())
// .get(mViewModel.javaClass) // not working either
}
inline fun<reified R> getGenericTClass() = R::class.java
}
at runtime