From e20a9294df7a68c0a31b209e8fdcd0107b474568 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 8 Oct 2016 20:05:01 +0200 Subject: [PATCH] close the app if the user goes Back from picking an image without pick --- .../gallery/activities/SetWallpaperActivity.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) }