From 03b37adc3c7ca2c8961151335242c16e40178d7d Mon Sep 17 00:00:00 2001 From: ligi Date: Sun, 10 Aug 2014 15:06:38 +0200 Subject: [PATCH] proper tear-down --- .../java/org/ligi/passandroid/ui/PassImportActivity.java | 2 +- src/main/java/org/ligi/passandroid/ui/UnzipPassDialog.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/ligi/passandroid/ui/PassImportActivity.java b/src/main/java/org/ligi/passandroid/ui/PassImportActivity.java index d697ab78..4ddbebd5 100644 --- a/src/main/java/org/ligi/passandroid/ui/PassImportActivity.java +++ b/src/main/java/org/ligi/passandroid/ui/PassImportActivity.java @@ -56,7 +56,7 @@ public class PassImportActivity extends ActionBarActivity { store.setCurrentPass(store.getPassbookForId(id)); AXT.at(PassImportActivity.this).startCommonIntent().activityFromClass(PassViewActivity.class); - + finish(); return null; } }); diff --git a/src/main/java/org/ligi/passandroid/ui/UnzipPassDialog.java b/src/main/java/org/ligi/passandroid/ui/UnzipPassDialog.java index f08b2e3b..6c1bebfe 100644 --- a/src/main/java/org/ligi/passandroid/ui/UnzipPassDialog.java +++ b/src/main/java/org/ligi/passandroid/ui/UnzipPassDialog.java @@ -31,7 +31,7 @@ public class UnzipPassDialog { if (activity.isFinishing()) { return; // no need to act any more .. } - ProgressDialog dialog = ProgressDialog.show(activity, "", "Opening the Passbook. Please wait...", true); + final ProgressDialog dialog = ProgressDialog.show(activity, "", "Opening the Passbook. Please wait...", true); class AlertDialogUpdater implements Runnable { @@ -49,6 +49,7 @@ public class UnzipPassDialog { @Override public void call(final String pathToPassbook) { + dialog.dismiss(); activity.runOnUiThread(new Runnable() { @Override public void run() { @@ -64,6 +65,9 @@ public class UnzipPassDialog { activity.runOnUiThread(new Runnable() { @Override public void run() { + if (dialog.isShowing()) { + dialog.dismiss(); + } if (myProgress.isShowing()) { myProgress.dismiss(); // TODO - check if it would be good to inform the user in another way