Answers for "get context kotlin viewmodel"

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

Browse Popular Code Answers by Language