You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm curious about the reason for directly handling Toast message events in the ViewModel by injecting the Application Context, especially since it's possible to handle these events in the view using Channel, SharedFlow, or StateFlow.(Using a method of emitting and collecting to events)
As this approach is used in the official Android sample repository, does it imply that injecting the Application Context into the ViewModel and handling context-required operations directly within the ViewModel is more recommended than the previously mentioned three methods?
The text was updated successfully, but these errors were encountered:
https://github.com/android/socialite/blob/main/app/src/main/java/com/google/android/samples/socialite/ui/camera/CameraViewModel.kt
https://github.com/android/socialite/blob/main/app/src/main/java/com/google/android/samples/socialite/ui/videoedit/VideoEditScreenViewModel.kt
I'm curious about the reason for directly handling Toast message events in the ViewModel by injecting the Application Context, especially since it's possible to handle these events in the view using Channel, SharedFlow, or StateFlow.(Using a method of emitting and collecting to events)
As this approach is used in the official Android sample repository, does it imply that injecting the Application Context into the ViewModel and handling context-required operations directly within the ViewModel is more recommended than the previously mentioned three methods?
The text was updated successfully, but these errors were encountered: