class CrimeListFragment : Fragment() { private lateinit var crimeRecyclerView: RecyclerView private var adapter: CrimeAdapter? = null private val crimeListViewModel: CrimeListViewModel by lazy { //ViewModelProvider.of(this).get(CrimeListViewModel::class.java) ViewModelProvider.AndroidViewModelFactory.getInstance(context?.applicationContext as Application).create(CrimeListViewModel::class.java) } }