Search code examples
androidandroid-intentshareintentfilter

How to create intent for sharing different files types simultaneously for android


In AndroidManifest.xml the following intent-filter allows to display the Android app while you select same types to share (all images or all videos).

<intent-filter>
   <action android:name="android.intent.action.MAIN"/>
   <category android:name="android.intent.category.LAUNCHER"/>
   <action android:name="android.intent.action.SEND" />
   <category android:name="android.intent.category.DEFAULT" />
   <data android:mimeType="image/*" />
   <data android:mimeType="audio/*"/>
   <data android:mimeType="video/*"/>
</intent-filter>

But if user select different types of content (image + video) the app with this intent is not is displaying in the share window.

So the question is - what intent should be used to display the app and allow to share files with different types simultaneously?

Thank you!


Solution

  • As @CommonsWare wrote android.intent.action.SEND_MULTIPLE will enable this option.