3

I'm trying to refactor my application to use the MVP pattern. I have one open issue: I'm connecting the View (Activity in my case) to the Presenter, but once the activity is going through config changes, destroy and creation, I want to connect the Activity to the same Presenter and save Activity state.

I don't want to make the Presenter as a static object to avoid memory leaks of an Activity. I prefer a solution without using a 3rd party libraries but if its recommended I prefer Dagger/EventBug. If you are recommending on Dagger, my question is, should my presenter has to be defined as a Singleton?

I also tried to find an example of MVP which handle this case of config changes but couldn't find something, so relevant examples will be good as well :)

galvan
  • 7,400
  • 7
  • 38
  • 55
  • Possible duplicate of [How to apply MVP pattern to android project](http://stackoverflow.com/questions/30704349/how-to-apply-mvp-pattern-to-android-project) – Paul Sweatte Jul 11 '16 at 06:33

0 Answers0