handle Action.Pick third party intent too

This commit is contained in:
tibbi 2022-07-03 11:42:09 +02:00
parent f55727c4b3
commit 53334fa8b0
2 changed files with 11 additions and 2 deletions

View File

@ -46,6 +46,14 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PICK" />
<data android:mimeType="*/*" />
<category android:name="android.intent.category.OPENABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.RINGTONE_PICKER" />
<category android:name="android.intent.category.DEFAULT" />

View File

@ -371,7 +371,7 @@ class MainActivity : SimpleActivity() {
}
val isPickRingtoneIntent = intent.action == RingtoneManager.ACTION_RINGTONE_PICKER
val isGetContentIntent = intent.action == Intent.ACTION_GET_CONTENT
val isGetContentIntent = intent.action == Intent.ACTION_GET_CONTENT || intent.action == Intent.ACTION_PICK
val allowPickingMultipleIntent = intent.getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)
val getContentMimeType = if (isGetContentIntent) {
intent.type ?: ""
@ -417,7 +417,8 @@ class MainActivity : SimpleActivity() {
private fun setupTabs() {
main_tabs_holder.removeAllTabs()
val isPickFileIntent = intent.action == RingtoneManager.ACTION_RINGTONE_PICKER || intent.action == Intent.ACTION_GET_CONTENT
val isPickFileIntent =
intent.action == RingtoneManager.ACTION_RINGTONE_PICKER || intent.action == Intent.ACTION_GET_CONTENT || intent.action == Intent.ACTION_PICK
if (isPickFileIntent) {
mTabsToShow.remove(TAB_STORAGE_ANALYSIS)
if (mTabsToShow.none { it and config.showTabs != 0 }) {