From 8b595f97964c17418fed579b1c0b7609edcd68bd Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Wed, 5 Oct 2011 13:57:38 -0700 Subject: [PATCH] Fixing the jsConfirm so it doesn't break the back button --- framework/src/com/phonegap/DroidGap.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java index cae4e7ef..12a9ad56 100755 --- a/framework/src/com/phonegap/DroidGap.java +++ b/framework/src/com/phonegap/DroidGap.java @@ -931,7 +931,7 @@ public class DroidGap extends PhonegapActivity { AlertDialog.Builder dlg = new AlertDialog.Builder(this.ctx); dlg.setMessage(message); dlg.setTitle("Confirm"); - dlg.setCancelable(false); + dlg.setCancelable(true); dlg.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { @@ -944,6 +944,12 @@ public class DroidGap extends PhonegapActivity { result.cancel(); } }); + dlg.setOnCancelListener( + new DialogInterface.OnCancelListener() { + public void onCancel(DialogInterface dialog) { + result.cancel(); + } + }); dlg.create(); dlg.show(); return true;