frogermcs/GithubClient

Presenter and Activity Lifecycle

charleschenster opened this issue · 2 comments

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

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.

Thanks, that answered my question!