package Ġcom . br ady . github job demo . ui Ċ Ċ import Ġandroid . arch . lifecycle . ViewModel Ċ import Ġandroid . arch . lifecycle . ViewModel Providers Ċ import Ġandroid . support . v 4 . app . Fragment Ċ import Ġkotlin . reflect . K Class Ċ Ċ abstract Ġclass ĠBase Fragment : ĠFragment () Ġ{ ĊĠĠĠ Ġfun Ġ< VM : ĠViewModel > Ġget ViewModel ( viewModel Class : ĠK Class < VM >): ĠVM Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠViewModel Providers . of ( activity !! ). get ( viewModel Class . java ) ĊĠĠĠ Ġ} Ċ }