Question

I have made a media player application. Everything works fine but I want that when user selects any media file then in the default popup window i want to include my application icon. For example when user selects any media file then android ask to user to complete this action using MusicPlayer, MX player etc. I want my application in that popup.

Thanks in advance

Was it helpful?

Solution

You'll need to add the following intent-filters to your activity in the manifest:

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="content"/>
    <data android:scheme="file"/>
    <data android:mimeType="audio/*"/>
</intent-filter>

If you want your app to show up only for mp3 files, try this:

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="audio/mp3" />  
    <data android:pathPattern="*.mp3" />
</intent-filter>

To read more on intent filters: Link.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top