Select Page

new AlertDialog.Builder(MainActivity.this)
.setTitle(“exit”)
.setMessage(“Are you want to exit?”)
.setIcon(R.drawable.exit_to_app_24)
.setCancelable(false)
.setPositiveButton(“yes”, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finishAndRemoveTask();
}
})
.setNegativeButton(“No”, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.show();