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

Android Team Lead at Tapsi