Great article. Just to note that I think the logic part (the loadData() part) should be done in a ViewModel to preserve it’s state, because the fragment might be destroyed in the middle of loading the data, but we still want to see the result when it is recreated, and also, we can map the data to a LiveData and observe it on the fragment side.

--

--

Android Team Lead at Tapsi

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adib Faramarzi

Adib Faramarzi

Android Team Lead at Tapsi

More from Medium

Online Journal 11: Anthony Bourdain’s Kitchen Confidential

The Magic in Your Mind (Book Review)

Breastfeeding: An Emotional Journey

Why Deleting Social Media Will Make You Happier