launching m3u playlist with intent

by Seb » Sun, 16 Aug 2009 21:11:31 GMT

Sponsored Links

Is there a way to launch a playlist whith intent?

I can retrieve the path of the m3u playlist with:
Cursor cursor = context.getContentResolver().query
(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, null, null, null,

But, I can't launch this m3u file neither with Intent nor with

Is there a way to do this?

Thanks in advance


launching m3u playlist with intent

by Marco Nelissen » Mon, 17 Aug 2009 03:23:56 GMT




Sponsored Links

launching m3u playlist with intent

by Marco Nelissen » Mon, 17 Aug 2009 03:30:16 GMT

 Well, OK, that's not entirely true. While you can't play an arbitrary
m3u file, you can play playlists that are in the database (which may
have come from m3u files originally, in which case there path is in
the _data column).
To see how, you can look at what happens when you put a shortcut to a
playlist on the home screen and then launch it.


launching m3u playlist with intent

by Seb » Mon, 17 Aug 2009 21:36:13 GMT

 Hi Marco,

Thank you very much for the response. You give me the key to find the

I had to study the code of PlaylistBrowserActivity to find the

I give it here if someone else search the solution:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setComponent(new ComponentName
intent.putExtra("oneshot", false);
intent.putExtra("playlist", playlistid);

and to retrieve the playlistid:
Cursor cursor = getContentResolver().query
(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, null, null, null,
if (cursor != null) {
 if (cursor.moveToFirst()) {
  do {
     playlistid = cursor.getString(cursor.getColumnIndex
     } while (cursor.moveToNext());


launching m3u playlist with intent

by » Fri, 11 Sep 2009 16:12:32 GMT

 Awesome. I love you! :)
This was just what I was looking for.


Other Threads

1. How can i show a prefilled contacts screen on android 2.0

Hi All,

I know the code below opens the native Edit/Add contact screen

Intent newIntent = new Intent(Intent.ACTION_INSERT,
startActivityForResult(newIntent, 1);

now i want this screen to be populated with some data in fields like
name, phone number, address etc. I found that if i do something like
newIntent.putExtra(ContactsContract.Intents.Insert.NAME,  "Some
will show this screen with name "Some Name" being shown in the name
field this is fine for me now i dont understand how will i fill the
city, state and zip fields similarly.
                 I found the ContactsContract.Intents.Insert has a
POSTAL attribute for address but there are no specific attributes for
city, state and zip in ContactsContract.Intents.Insert.
                Also i found that
ContactsContract.CommonDataKinds.StructuredPostal has the city, state
and zip attributes but still i dont know how can i use this to
prepopulate the Edit/Add contact screen  with values of city, state
and zip.

Please Help me with this,


2. SmsManager and double SMS message


I am using following code to send sms message:

SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNo, null, message, null, null);

But when this code is executed two sms messages are sent.
Does anybody have idea what can be a problem?

I am using HTC Tattoo with android 1.6


3. How to create an icon on the status bar ?

4. How to lock the Screen customly? Just like WaveSecure in Android

5. Why?

6. Issue 1257:Calendar should support opening iCal .ics files

7. Have Untyped DataSet from a Webservice call. How do I translate that to show in Android App?