mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
get proper mimetype at Get Content intents
This commit is contained in:
@ -370,10 +370,20 @@ class MainActivity : SimpleActivity() {
|
|||||||
openPath(config.homeFolder)
|
openPath(config.homeFolder)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val isPickRingtoneIntent = intent.action == RingtoneManager.ACTION_RINGTONE_PICKER
|
||||||
|
val isGetContentIntent = intent.action == Intent.ACTION_GET_CONTENT
|
||||||
|
val allowPickingMultipleIntent = intent.getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)
|
||||||
|
val getContentMimeType = if (isGetContentIntent) {
|
||||||
|
intent.type ?: ""
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
}
|
||||||
|
|
||||||
getAllFragments().forEach {
|
getAllFragments().forEach {
|
||||||
it?.isGetRingtonePicker = intent.action == RingtoneManager.ACTION_RINGTONE_PICKER
|
it?.isGetRingtonePicker = isPickRingtoneIntent
|
||||||
it?.isGetContentIntent = intent.action == Intent.ACTION_GET_CONTENT
|
it?.isPickMultipleIntent = allowPickingMultipleIntent
|
||||||
it?.isPickMultipleIntent = intent.getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)
|
it?.isGetContentIntent = isGetContentIntent
|
||||||
|
it?.getContentMimeType = getContentMimeType
|
||||||
}
|
}
|
||||||
|
|
||||||
if (refreshRecents) {
|
if (refreshRecents) {
|
||||||
|
@ -19,6 +19,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
|||||||
var isGetContentIntent = false
|
var isGetContentIntent = false
|
||||||
var isGetRingtonePicker = false
|
var isGetRingtonePicker = false
|
||||||
var isPickMultipleIntent = false
|
var isPickMultipleIntent = false
|
||||||
|
var getContentMimeType = ""
|
||||||
|
|
||||||
protected fun clickedPath(path: String) {
|
protected fun clickedPath(path: String) {
|
||||||
if (isGetContentIntent) {
|
if (isGetContentIntent) {
|
||||||
|
Reference in New Issue
Block a user