Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onBackPressed() {
- new AlertDialog.Builder(this)
- .setIcon(android.R.drawable.ic_dialog_alert)
- .setTitle("Exit App")
- .setMessage("Are you sure you want to exit?")
- .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- finish();
- }
- })
- .setNegativeButton("No", null)
- .show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement