From c0da2ef6c6413707e1c32aca3b1e5f155a849755 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 28 Nov 2019 23:23:56 +0100 Subject: [PATCH] fix #1648, properly handle View intent with no data, launch main screen --- .../gallery/pro/activities/PhotoVideoActivity.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt index 71080ca0d..82ee18c29 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt @@ -71,6 +71,12 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList } private fun checkIntent(savedInstanceState: Bundle? = null) { + if (intent.data == null && intent.action == Intent.ACTION_VIEW) { + startActivity(Intent(this, MainActivity::class.java)) + finish() + return + } + mUri = intent.data ?: return val uri = mUri.toString() if (uri.startsWith("content:/") && uri.contains("/storage/")) {