-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Shared ViewModel Sample | ||
### How to communicate between fragments and activity? | ||
Before `ViewModel` the best way was to use interface to communicate or pass date between fragments and activity. But, now we can use `ViewModel` and it will be very easy. We just need to create the ViewModel in activity scope and thats it. Just observer the ViewModel. This is a sample project to show the `Shared ViewModel` implemneteation. | ||
|
||
Tutorial and related article on [medium](https://medium.com/@shuza.sa/how-to-communicate-between-fragments-and-activity-using-viewmodel-ca733233a51c). |