Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResubscriptionObserver in MVP #25

Closed
meierjan opened this issue Aug 22, 2016 · 2 comments
Closed

ResubscriptionObserver in MVP #25

meierjan opened this issue Aug 22, 2016 · 2 comments

Comments

@meierjan
Copy link

meierjan commented Aug 22, 2016

Does the ResubscriptionObserver with @AutoResubscribe have to be inside the activity or can I put it somewhere else like into the Presenter?

I am injecting the GroupLifecycleManager into the presenter to use it and of course calling the life cycle methods inside the activity.

@elihart
Copy link
Contributor

elihart commented Aug 22, 2016

You can put it in any class, the Presenter would be a fine option.

You just have to make sure to call groupLifecycleManager.subscribe(presenter) so that the manager knows where to look for the @AutoResubscribe annotations and observers.

A pattern we use is to pass a manager to a helper class via its constructor, and then inside the class's constructor we save the manager to a field and do groupLifecycleManager.subscribe(this).

@meierjan
Copy link
Author

meierjan commented Aug 23, 2016

Thank you for the fast reply. Maybe its a good idea to add this to the readme 👍 works like charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants