diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt index 9093ae28..6a0bd407 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt @@ -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) { diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/MyViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/MyViewPagerFragment.kt index 290e01b1..910f6775 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/MyViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/MyViewPagerFragment.kt @@ -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) {