From 02ac70e2a79d74f159bf59eca09e71234a769b34 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Sat, 20 Aug 2016 00:05:06 +0200 Subject: [PATCH] Only dismiss the dialog is the activity is still alive --- .../freeyourgadget/gadgetbridge/activities/DebugActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DebugActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DebugActivity.java index f4f10bd2d..d55f5a30e 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DebugActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DebugActivity.java @@ -322,7 +322,9 @@ public class DebugActivity extends GBActivity { @Override protected Object doInBackground(Object[] params) { helper.importOldDb(oldHandler, device, targetHandler); - progress.dismiss(); + if (!isFinishing() && !isDestroyed()) { + progress.dismiss(); + } return null; } }.execute((Object[]) null);