Dagger-Non-Configuration-Scope
Dagger-Non-Configuration-Scope copied to clipboard
Calling retrieveInjectorOrCreateNew() after onCreate() will cause NPE in fragment
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!