diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index 8ce60f1f5..ac8cdb4dc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -34,6 +34,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener var resizeWidth = 0 var resizeHeight = 0 var isCropIntent = false + var isEditingWithThirdParty = false override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -63,6 +64,17 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener } } + override fun onResume() { + super.onResume() + isEditingWithThirdParty = false + } + + override fun onStop() { + super.onStop() + if (isEditingWithThirdParty) + finish() + } + override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.menu_editor, menu) menu.findItem(R.id.resize).isVisible = !isCropIntent @@ -193,7 +205,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener private fun editWith() { openEditor(uri, true) - finish() + isEditingWithThirdParty = true } private fun scanFinalPath(path: String) {