Search code examples
androidwhatsappintentfilterandroid-sharing

<intent-filter> for WhatsApp audio shares


I want to be able to handle intents from WhatsApp when the user selects share on an audio clip. Several audio apps are able to handle it, but mine is not listed in the share dialog. My current intent-filter works for just about every other app. It is:

           <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="audio/*" />
                <data android:mimeType="application/x-flac" />
                <data android:mimeType="application/flac" />
                <data android:mimeType="application/ogg" />
                <data android:mimeType="application/x-ogg" />
                <data android:mimeType="video/mp4" />
                <data android:mimeType="video/3gpp" />
            </intent-filter>

I've tried using the */* mime type, and using the OPEN_DOCUMENT action to no avail. According to the docs, file and content schemes are implied by by intent-filter, is there another one I need to use for WhatsApp?


Solution

  • The easy answer is we must have an intent-filter that handles android.intent.action.SEND