2 years ago
#75311
braml1
UI events from ViewModel to View in Android Java
I am trying for an elegant way to send an event from a ViewModel to a View in Android using Java. This would be for one shot events like for showing a toast. Android recommends to use MutableStateFlow. However a similar pattern does not seem to be available for Java. What would be the recommended way, using LiveData and an observer in the activity? Does someone have a simple code pattern?
java
android
mvvm
android-livedata
0 Answers
Your Answer