Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Intent startMain = new Intent(Intent.ACTION_MAIN);
- startMain.addCategory(Intent.CATEGORY_HOME);
- startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- startActivity(startMain);
- @Override
- public void onBackPressed()
- {
- // code here to show dialog
- super.onBackPressed(); // optional depending on your needs
- finish();
- }
- onBackPressed();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement