Answers for "kotlin get context in fragment"

0

get context in view model kotlin

class ActivityViewModel(application: Application) : AndroidViewModel(application) {

    private val context = getApplication<Application>().applicationContext

    //... ViewModel methods 

}
Posted by: Guest on September-02-2021
1

context kotlin

don't send context to another class, it's not efficient, 
instead manage where context is remotely with structures like viewModel
Posted by: Guest on December-09-2021

Code answers related to "kotlin get context in fragment"

Browse Popular Code Answers by Language