How can I use the string resource's data in the vi...
# compose-android
m
How can I use the string resource's data in the viewModel so I can make a search of a given list of data?
l
You can use
AndroidViewModel
to access
Context
in view model safely
m
@Lanh Trần so you mean instead of extending
ViewModel()
class,, I'll extend
AndroidViewModel