NohaSamir / PopularMovies

We will take the Movies Application in journey to Android Architecture component.
28 stars 8 forks source link

What if a detail inside the ViewModel changed ?? #7

Open fadi-botros opened 5 years ago

fadi-botros commented 5 years ago

https://github.com/NohaSamir/PopularMovies/blob/44d3969858e10013bd3c359c48aab475913b2501/app/src/main/java/com/example/android/popularmovies/view_model/MainViewModel.java#L25

More good work by you. But, what if a Movie (for example, if there is a number of reviews), changed ??

Would you reload all data by changing the LiveData content to the new List ?

NohaSamir commented 5 years ago

You can create method onChang and post the new value inside it

For more details you can check this answer https://stackoverflow.com/a/52287357