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

Why do we need activity scope? #11

Open
chaitanya-exp opened this issue Nov 29, 2017 · 2 comments
Open

Why do we need activity scope? #11

chaitanya-exp opened this issue Nov 29, 2017 · 2 comments
Labels

Comments

@chaitanya-exp
Copy link

We need new presenter on every activity creation anyways. If it is to handle activity recreation then the associated component will also be recreated which in turns results in new presenter object.

@ragdroid
Copy link
Owner

@chaitanya-exp It is for demonstration purposes, In future there can be a few dependencies which will live during the scope of for example just HomeActivity, like HomeActivityRouter (which can manage navigation between various fragments within HomeActivity, same instance can be injected into all three fragments but for a different activity I would still create a new Router. There could be multiple such examples. Here's just to demonstrate how we can do this.

@chaitanya-exp
Copy link
Author

Thanks for the clarification. All the dagger related repos seem to use activity, fragment scope in their examples without a suitable usecase.

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

No branches or pull requests

2 participants