Presenter and Activity Lifecycle
charleschenster opened this issue · 2 comments
charleschenster commented
Hi Mirosław!
Thanks for the tutorials and introduction to Dagger 2. After some research, a common issue with using ReactiveX programming for Android applications is properly handling unsubcribes when the Activity is destroyed. How is it handled here? Should the Presenters also have an "onDestroy" method which is called by the Activity when it is getting destroyed? Or is Dagger 2 somehow helping us here?
Thanks!
-- Charles
frogermcs commented
In this example it isn't handled but in general I create onPause() methods in presenter which is called from Activity. And there i call unsubscribe() on rx subscriptions.
charleschenster commented
Thanks, that answered my question!