close the app if the user goes Back from picking an image without pick

This commit is contained in:
tibbi 2016-10-08 20:05:01 +02:00
parent b34fbabbf8
commit e20a9294df
1 changed files with 6 additions and 2 deletions

View File

@ -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)
}