you can create a later init variable before the call of onCreate fucntion and then assign the value to the variable after calling overrive onCreate fucntion , this enable you to use the fucntion glbally in the app and then migrate the viewmodel outide the main activity , in a seperate file