From d80a0db3cb368801929cf86fe4f58747d2ac846f Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 6 Mar 2017 23:18:47 +0100 Subject: [PATCH] check if the activity is still alive after cropping for wallpaper --- .../gallery/activities/SetWallpaperActivity.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt index 594f1afba..a0381cd99 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt @@ -66,6 +66,9 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete } override fun onCropImageComplete(view: CropImageView?, result: CropImageView.CropResult) { + if (isDestroyed) + return + if (result.error == null) { toast(R.string.setting_wallpaper) Thread({