Skip to content

Commit 6995978

Browse files
author
Ryan Williams
authored
set cancelable to false by default on Android
Thanks to apache#56
1 parent 0b532b6 commit 6995978

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/android/Notification.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public void run() {
168168
AlertDialog.Builder dlg = createDialog(cordova); // new AlertDialog.Builder(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
169169
dlg.setMessage(message);
170170
dlg.setTitle(title);
171-
dlg.setCancelable(true);
171+
dlg.setCancelable(false);
172172
dlg.setPositiveButton(buttonLabel,
173173
new AlertDialog.OnClickListener() {
174174
public void onClick(DialogInterface dialog, int which) {
@@ -208,7 +208,7 @@ public void run() {
208208
AlertDialog.Builder dlg = createDialog(cordova); // new AlertDialog.Builder(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
209209
dlg.setMessage(message);
210210
dlg.setTitle(title);
211-
dlg.setCancelable(true);
211+
dlg.setCancelable(false);
212212

213213
// First button
214214
if (buttonLabels.length() > 0) {
@@ -298,7 +298,7 @@ But for some android versions is not visible (for example 5.1.1).
298298
AlertDialog.Builder dlg = createDialog(cordova); // new AlertDialog.Builder(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
299299
dlg.setMessage(message);
300300
dlg.setTitle(title);
301-
dlg.setCancelable(true);
301+
dlg.setCancelable(false);
302302

303303
dlg.setView(promptInput);
304304

@@ -401,7 +401,7 @@ public void run() {
401401
notification.spinnerDialog = createProgressDialog(cordova); // new ProgressDialog(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
402402
notification.spinnerDialog.setTitle(title);
403403
notification.spinnerDialog.setMessage(message);
404-
notification.spinnerDialog.setCancelable(true);
404+
notification.spinnerDialog.setCancelable(false);
405405
notification.spinnerDialog.setIndeterminate(true);
406406
notification.spinnerDialog.setOnCancelListener(
407407
new DialogInterface.OnCancelListener() {
@@ -444,7 +444,7 @@ public void run() {
444444
notification.progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
445445
notification.progressDialog.setTitle(title);
446446
notification.progressDialog.setMessage(message);
447-
notification.progressDialog.setCancelable(true);
447+
notification.progressDialog.setCancelable(false);
448448
notification.progressDialog.setMax(100);
449449
notification.progressDialog.setProgress(0);
450450
notification.progressDialog.setOnCancelListener(

0 commit comments

Comments
 (0)