From c885445b51111b17085e7e095185b651717bd67b Mon Sep 17 00:00:00 2001 From: Lode Hoste Date: Sun, 22 Mar 2015 21:06:26 +0100 Subject: [PATCH] Do not modify gui if it is destroyed --- .../com/nutomic/syncthingandroid/activities/MainActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java b/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java index e7f3019f..2950a653 100644 --- a/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java @@ -49,7 +49,7 @@ public class MainActivity extends SyncthingActivity @Override @SuppressLint("InflateParams") public void onApiChange(SyncthingService.State currentState) { - if (currentState != SyncthingService.State.ACTIVE && !isFinishing()) { + if (currentState != SyncthingService.State.ACTIVE && !isFinishing() && !isDestroyed()) { if (currentState == SyncthingService.State.DISABLED) { if (mLoadingDialog != null) { mLoadingDialog.dismiss();