diff options
Diffstat (limited to 'platform/android/src/com/artifex/mupdfdemo')
-rw-r--r-- | platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java b/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java index e9922a34..066b6d5f 100644 --- a/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java +++ b/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java @@ -9,6 +9,7 @@ import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.DialogInterface.OnCancelListener; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Resources; @@ -329,6 +330,13 @@ public class MuPDFActivity extends Activity implements FilePicker.FilePickerSupp finish(); } }); + alert.setOnCancelListener(new OnCancelListener() { + + @Override + public void onCancel(DialogInterface dialog) { + finish(); + } + }); alert.show(); return; } @@ -1083,7 +1091,7 @@ public class MuPDFActivity extends Activity implements FilePicker.FilePickerSupp @Override public void onBackPressed() { - if (core.hasChanges()) { + if (core != null && core.hasChanges()) { DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { if (which == AlertDialog.BUTTON_POSITIVE) |