Last active
August 24, 2017 19:00
-
-
Save anandgaurav10/cc21c32c98178f7393459f409b59af91 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 class SplashActivity extends BaseActivity implements SplashMvpView { | |
SplashPresenter mSplashPresenter; | |
public static Intent getStartIntent(Context context) { | |
Intent intent = new Intent(context, SplashActivity.class); | |
return intent; | |
} | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_splash); | |
DataManager dataManager = ((MvpApp) getApplication()).getDataManager(); | |
mSplashPresenter = new SplashPresenter(dataManager); | |
mSplashPresenter.onAttach(this); | |
mSplashPresenter.decideNextActivity(); | |
} | |
@Override | |
public void openMainActivity() { | |
Intent intent = MainActivity.getStartIntent(this); | |
startActivity(intent); | |
finish(); | |
} | |
@Override | |
public void openLoginActivity() { | |
Intent intent = LoginActivity.getStartIntent(this); | |
startActivity(intent); | |
finish(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment