Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SharedPreferences sharedPrefs = getApplicationContext().getSharedPreferences(NOME_PREFS, Context.MODE_PRIVATE);
- if (!sharedPrefs.getBoolean("primeiroAcesso", false)) {
- Intent intent = new Intent(this, BoasVindasActivity.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
- startActivity(intent);
- finish();
- return;
- }
- SharedPreferences.Editor editor = sharedPrefs.edit();
- editor.putBoolean("primeiroAcesso", true);
- editor.commit();
- Intent intent = new Intent(this, MainActivity.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
- finish();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement