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

Calling retrieveInjectorOrCreateNew() after onCreate() will cause NPE in fragment #2

Open
wingu-wiktor opened this issue Aug 8, 2017 · 0 comments

Comments

@wingu-wiktor
Copy link

wingu-wiktor commented Aug 8, 2017

If fragment uses the same component as activity, after rotation fragment's onCreate() will be called before activity's onCreate(), causing NPE.
So if you use fragment (that share the same component) this is the correct order, I believe:

injector = retrieveInjectorOrCreateNew();
super.onCreate(savedInstanceState);

Mateusz do you use it that way (fragments are using component from activity) or they have separate component ?
And do you use one scope for all activities (NonConfigurationScope) ?

Ps.
This way to retain presenters is very clever, thanks for your time to share this!

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

1 participant