Created
August 13, 2016 15:08
-
-
Save frogermcs/c22f41b80db816623fd0795d520cd683 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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