diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java b/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java index f18b8fdab..535fda29a 100644 --- a/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java @@ -265,8 +265,23 @@ public class UpdaterActivity extends Activity { } }; - //disable back button + //show warning on back pressed @Override public void onBackPressed() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setMessage(R.string.cancel_update) + .setCancelable(false) + .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + UpdaterActivity.this.finish(); + } + }) + .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + dialog.cancel(); + } + }); + AlertDialog alert = builder.create(); + alert.show(); } } |