Android Studio – How to access packagemanager in viewmodel
I was using fragment and now I attached ViewModel to it and was transferring code to ViewModel and activity?.packageManager?.getPackageInfo(uri, PackageManager.GET_ACTIVITIES) this line shows an error. How can I access package manager in ViewModel?