Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Reference: https://stackoverflow.com/questions/6413700/android-proper-way-to-use-onbackpressed-with-toast
- //Accessed on 12 May 2018
- @Override
- public void onBackPressed() {
- new AlertDialog.Builder(this)
- .setMessage(R.string.are_you_sure_exit)
- .setNegativeButton(R.string.no, null)
- .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface arg0, int arg1) {
- DefaultSettings.super.onBackPressed();
- }
- }).create().show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement