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

View file

@ -88,8 +88,12 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete
} }
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == PICK_IMAGE && resultCode == Activity.RESULT_OK && data != null) { if (requestCode == PICK_IMAGE) {
handleImage(data) if (resultCode == Activity.RESULT_OK && data != null) {
handleImage(data)
} else {
finish()
}
} }
super.onActivityResult(requestCode, resultCode, data) super.onActivityResult(requestCode, resultCode, data)
} }