mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-04-15 18:57:23 +02:00
fix sharing files
This commit is contained in:
parent
3bacadac13
commit
48d0a1885e
@ -156,9 +156,15 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList<FileDir
|
|||||||
|
|
||||||
val shareTitle = activity.resources.getString(R.string.share_via)
|
val shareTitle = activity.resources.getString(R.string.share_via)
|
||||||
Intent().apply {
|
Intent().apply {
|
||||||
action = if (uris.size <= 1) Intent.ACTION_SEND else Intent.ACTION_SEND_MULTIPLE
|
if (uris.size <= 1) {
|
||||||
|
action = Intent.ACTION_SEND
|
||||||
|
putExtra(Intent.EXTRA_STREAM, uris.first())
|
||||||
|
} else {
|
||||||
|
action = Intent.ACTION_SEND_MULTIPLE
|
||||||
putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris)
|
putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris)
|
||||||
|
}
|
||||||
type = getMimeType(uris)
|
type = getMimeType(uris)
|
||||||
|
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||||
activity.startActivity(Intent.createChooser(this, shareTitle))
|
activity.startActivity(Intent.createChooser(this, shareTitle))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user