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)
|
||||
}
|
||||
|
||||
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 {
|
||||
it?.isGetRingtonePicker = intent.action == RingtoneManager.ACTION_RINGTONE_PICKER
|
||||
it?.isGetContentIntent = intent.action == Intent.ACTION_GET_CONTENT
|
||||
it?.isPickMultipleIntent = intent.getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)
|
||||
it?.isGetRingtonePicker = isPickRingtoneIntent
|
||||
it?.isPickMultipleIntent = allowPickingMultipleIntent
|
||||
it?.isGetContentIntent = isGetContentIntent
|
||||
it?.getContentMimeType = getContentMimeType
|
||||
}
|
||||
|
||||
if (refreshRecents) {
|
||||
|
@ -19,6 +19,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
||||
var isGetContentIntent = false
|
||||
var isGetRingtonePicker = false
|
||||
var isPickMultipleIntent = false
|
||||
var getContentMimeType = ""
|
||||
|
||||
protected fun clickedPath(path: String) {
|
||||
if (isGetContentIntent) {
|
||||
|
Reference in New Issue
Block a user