Register as music player and play song
<p>I'm creating a music player app and I want to register the app as a music player. So that when a user clicks on any song to play, my app should be suggested as one of the music players. I followed <a href="https://stackoverflow.com/questions/15768379/register-as-music-player">this guide </a>. </p>

<p>After I added the necessary code in manifest.xml, it only shows my app in suggestions. When I select my app, nothing is played. I think there should be something like receiver in main activity to receive the media path to play the selected song. But I don't know how to implement this. </p>

<p>I've added following code to my manifest.xml (for reference):</p>

<pre><code>&lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.VIEW" /&gt;
        &lt;category android:name="android.intent.category.DEFAULT" /&gt;
        &lt;data android:scheme="file"/&gt;
        &lt;data android:mimeType="audio/*"/&gt;
        &lt;data android:mimeType="application/ogg"/&gt;
        &lt;data android:mimeType="application/x-ogg"/&gt;
        &lt;data android:mimeType="application/itunes"/&gt;
    &lt;/intent-filter&gt;
    &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.VIEW" /&gt;
        &lt;category android:name="android.intent.category.DEFAULT" /&gt;
        &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
        &lt;data android:scheme="http" /&gt;
        &lt;data android:mimeType="audio/*"/&gt;
        &lt;data android:mimeType="application/ogg"/&gt;
        &lt;data android:mimeType="application/x-ogg"/&gt;
        &lt;data android:mimeType="application/itunes"/&gt;
    &lt;/intent-filter&gt;
    &lt;intent-filter
        android:priority="-1"&gt;
        &lt;action android:name="android.intent.action.VIEW" /&gt;
        &lt;category android:name="android.intent.category.DEFAULT" /&gt;
        &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
        &lt;data android:scheme="content" /&gt;
        &lt;data android:mimeType="audio/*"/&gt;
        &lt;data android:mimeType="application/ogg"/&gt;
        &lt;data android:mimeType="application/x-ogg"/&gt;
        &lt;data android:mimeType="application/itunes"/&gt;
    &lt;/intent-filter&gt;
</code></pre>