Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public abstract class BaseUserActivity extends BaseActivity {
@Inject
UserManager userManager;
@Override
protected void setupActivityComponent(AppComponent appComponent) {
appComponent.inject(this);
setupUserComponent();
}
private void setupUserComponent() {
isUserSessionStarted = userManager.isUserSessionStartedOrStartSessionIfPossible();
onUserComponentSetup(userManager.getUserComponent());
//This screen cannot work when user session is not started.
if (!isUserSessionStarted) {
finish();
}
}
protected abstract void onUserComponentSetup(UserComponent userComponent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment