fixing a glitch at third party intents, hopefully fixed #1311 and #1309

This commit is contained in:
tibbi 2019-03-04 20:16:45 +01:00
parent 3804be49e3
commit ae031af161
1 changed files with 6 additions and 4 deletions

View File

@ -77,10 +77,12 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
val uri = mUri.toString()
if (uri.startsWith("content:/") && uri.contains("/storage/")) {
val guessedPath = uri.substring(uri.indexOf("/storage/"))
val extras = intent.extras ?: Bundle()
extras.apply {
putString(REAL_FILE_PATH, guessedPath)
intent.putExtras(this)
if (File(guessedPath).exists()) {
val extras = intent.extras ?: Bundle()
extras.apply {
putString(REAL_FILE_PATH, guessedPath)
intent.putExtras(this)
}
}
}