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 0735f3846..f49d4b373 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt @@ -88,8 +88,12 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { - if (requestCode == PICK_IMAGE && resultCode == Activity.RESULT_OK && data != null) { - handleImage(data) + if (requestCode == PICK_IMAGE) { + if (resultCode == Activity.RESULT_OK && data != null) { + handleImage(data) + } else { + finish() + } } super.onActivityResult(requestCode, resultCode, data) }