I have an app which have 2 activities which both can handle android.intent.action.GET_CONTENT action:
<!-- activity 1 -->
<activity android:icon="@drawable/choose_video"
android:label="@string/choose_video"
android:name=".activity.ChooseVideoActivity">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="application/sample.get.video"/>
<action android:name="android.intent.action.GET_CONTENT"/>
</intent-filter>
</activity>
<!-- activity 2 -->
<activity android:icon="@drawable/record_video"
android:label="@string/record_video"
android:name=".activity.RecordVideoActivity">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="application/sample.get.video"/>
<action android:name="android.intent.action.GET_CONTENT"/>
</intent-filter>
</activity>
I'm using following code to launch chooser:
Intent sendIntent = new Intent(Intent.ACTION_GET_CONTENT);
sendIntent.setType("application/sample.get.video");
sendIntent.putExtra(Intent.EXTRA_MIME_TYPES, new String[]{"video/*"});
startActivityForResult(Intent.createChooser(sendIntent, null), CODE_VIDEO);
On Android versions prior to 10 (api ver. <= 28) everything works OK: if Files app is installed, then it opens with my 2 activities available in Appdrawer menu along with other apps that can handle this action (usually Google Drive is there). If there is no Files app then chooser shows up. But on Android 10 it behaves differently: it shows only one activity from my app instead of two.
The Question is, does anybody know what exactly was changed in Android 10 that is causing such behavior, and maybe knows a solution to this problem. Or, alternatively, how to achieve similar behavior with other methods (show 2 icons from my app in Files app's menu while selecting a video)