문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top