1new AlertDialog.Builder(this)
2 .setTitle("Closing application")
3 .setMessage("Are you sure you want to exit?")
4 .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
5 @Override
6 public void onClick(DialogInterface dialog, int which) {
7
8 }
9 }).setNegativeButton("No", null).show();
10