Play audio from content
<p>I'm writing an android reminder which play an audio at user specified times.</p>

<p>I have one bundled mp3 in asset directory and let the user to choose custom audio in preference activity.</p>

<p>I use media player CompletionListener so when it ends I release the locks.</p>

<p>When I play the mp3 from asset directory  with this code:</p>

<pre><code>afd = getAssets().openFd("alarm.mp3");
player.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
</code></pre>

<p>it works perfect but when I play the selected audio which has a content scheme:</p>

<pre><code>afd = getContentResolver().openAssetFileDescriptor(Uri.parse("content://media/internal/audio/media/75"), "r");
player.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
</code></pre>

<p>It plays audio but repeats forever, although looping is off and it works with asset.</p>
