Android Architecture Components: ViewModel
Why should I use ViewModel? Suppose I have an activity. I have a presenter class of this activity (MVP design pattern) from which I am downloading data from server. But before getting data from server, unfortunately I rotated the phone. What will happen now? Activity will be recreated, which means the presenter object will be recreated. Here again for getting data, presenter will call server … Continue reading Android Architecture Components: ViewModel