czyrux / MvpLoaderSample

Sample project to showcase how to use Android Loaders with MVP to preserve Presenter across orientation changes
140 stars 24 forks source link

Use supportloadermanager in basepresenterfragment. #5

Closed dblackker closed 8 years ago

czyrux commented 8 years ago

This change will introduce a not desired effect. When you access to getActivity().getSupportLoaderManager(), you are using the same LoaderManager that the activity. The main idea with the Presenter-Loader approach was that each Fragment has an independent LoaderManager, with a lifecycle attached to its fragment and nobody else. With this change all fragments in the activity will share the same LoaderManager, and then you will need to be careful about which ids to use for the presenters.