Vivek Modi
07/01/2021, 11:50 AMVivek Modi
07/01/2021, 11:50 AMclass XYZViewModel(val context: Context) : BaseViewModel()Vivek Modi
07/01/2021, 11:51 AMval xyzModule = module {
viewModel { XYZViewModel(get()) }
}Rak
07/01/2021, 12:26 PMVivek Modi
07/01/2021, 12:26 PMVivek Modi
07/01/2021, 12:34 PMRak
07/01/2021, 12:55 PMVivek Modi
07/01/2021, 12:56 PMRak
07/01/2021, 12:58 PMViewModel needs the Application context, for example to find a system service, it can extend the AndroidViewModel class and have a constructor that receives the Application in the constructor, since Application class extends Context.”Rak
07/01/2021, 12:59 PMsingle { PermissionUtils(androidContext()) }
this is a line from mineVivek Modi
07/01/2021, 12:59 PMRak
07/01/2021, 12:59 PMclass PermissionUtils(private val context: Context) {Vivek Modi
07/01/2021, 1:00 PM