Skip to content

Commit 53334fa

Browse files
committed
handle Action.Pick third party intent too
1 parent f55727c commit 53334fa

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646
<category android:name="android.intent.category.DEFAULT" />
4747
</intent-filter>
4848

49+
<intent-filter>
50+
<action android:name="android.intent.action.PICK" />
51+
<data android:mimeType="*/*" />
52+
53+
<category android:name="android.intent.category.OPENABLE" />
54+
<category android:name="android.intent.category.DEFAULT" />
55+
</intent-filter>
56+
4957
<intent-filter>
5058
<action android:name="android.intent.action.RINGTONE_PICKER" />
5159
<category android:name="android.intent.category.DEFAULT" />

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ class MainActivity : SimpleActivity() {
371371
}
372372

373373
val isPickRingtoneIntent = intent.action == RingtoneManager.ACTION_RINGTONE_PICKER
374-
val isGetContentIntent = intent.action == Intent.ACTION_GET_CONTENT
374+
val isGetContentIntent = intent.action == Intent.ACTION_GET_CONTENT || intent.action == Intent.ACTION_PICK
375375
val allowPickingMultipleIntent = intent.getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)
376376
val getContentMimeType = if (isGetContentIntent) {
377377
intent.type ?: ""
@@ -417,7 +417,8 @@ class MainActivity : SimpleActivity() {
417417

418418
private fun setupTabs() {
419419
main_tabs_holder.removeAllTabs()
420-
val isPickFileIntent = intent.action == RingtoneManager.ACTION_RINGTONE_PICKER || intent.action == Intent.ACTION_GET_CONTENT
420+
val isPickFileIntent =
421+
intent.action == RingtoneManager.ACTION_RINGTONE_PICKER || intent.action == Intent.ACTION_GET_CONTENT || intent.action == Intent.ACTION_PICK
421422
if (isPickFileIntent) {
422423
mTabsToShow.remove(TAB_STORAGE_ANALYSIS)
423424
if (mTabsToShow.none { it and config.showTabs != 0 }) {

0 commit comments

Comments
 (0)