fix #1648, properly handle View intent with no data, launch main screen

This commit is contained in:
tibbi 2019-11-28 23:23:56 +01:00
parent 518126de3a
commit c0da2ef6c6

View file

@ -71,6 +71,12 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
} }
private fun checkIntent(savedInstanceState: Bundle? = null) { 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 mUri = intent.data ?: return
val uri = mUri.toString() val uri = mUri.toString()
if (uri.startsWith("content:/") && uri.contains("/storage/")) { if (uri.startsWith("content:/") && uri.contains("/storage/")) {