mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
get proper path at returning a third party intent result
This commit is contained in:
@ -537,7 +537,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun fillIntentPath(resultData: Intent, resultIntent: Intent) {
|
private fun fillIntentPath(resultData: Intent, resultIntent: Intent) {
|
||||||
val path = resultData.data.path
|
val data = resultData.data
|
||||||
|
val path = if (data.toString().startsWith("/")) data.toString() else data.path
|
||||||
val uri = getFilePublicUri(File(path), BuildConfig.APPLICATION_ID)
|
val uri = getFilePublicUri(File(path), BuildConfig.APPLICATION_ID)
|
||||||
val type = path.getMimeType()
|
val type = path.getMimeType()
|
||||||
resultIntent.setDataAndTypeAndNormalize(uri, type)
|
resultIntent.setDataAndTypeAndNormalize(uri, type)
|
||||||
|
Reference in New Issue
Block a user