Skip to content

Instantly share code, notes, and snippets.

@hamadycisse
Created November 17, 2019 18:51
Show Gist options
  • Save hamadycisse/a013c1ec21b9e8f911d0fc08600c892b to your computer and use it in GitHub Desktop.
Save hamadycisse/a013c1ec21b9e8f911d0fc08600c892b to your computer and use it in GitHub Desktop.
public abstract class AuthenticatedBaseActivity
extends ConnectedBaseActivity
implements SlidingDrawer.OnDrawerOpenListener, SlidingDrawer.OnDrawerCloseListener {
@Inject
protected InjectionScopes injectionScopes;
@Override
public void onCreate(Bundle savedInstanceState) {
UserScopeSubcomponent userScope = ((OurApp) getApplication()).getAppScopes().getUserScope();
if (userScope != null) {
Provider<AndroidInjector.Factory<?>> factoryProvider = userScope.getUserScopeActivitiesAndroidInjectorFactories().get(getClass());
if (factoryProvider != null) {
AndroidInjector.Factory<?> factory = factoryProvider.get();
((AndroidInjector.Factory<AuthenticatedBaseActivity>) factory).create(this).inject(this);
}
}
super.onCreate(savedInstanceState);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment