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. Launch ContextMenu from ContextMenu

How can I launch a contextmenu from a contextmenu?

I'm trying to replicate the MediaPlayer action that happens when you
long click a song, then click "Add to playlist" in the resulting
contextmenu. When you click that menu item, another contextmenu pops
up with "Add to playlist" as the title, and "Current playlist", "New",
and however-many-playlists-you-have defined after that.



2. How to increase FPS (now ~20, desired ~40-50)

Hi Andre,

you should definitely read the "Designing for Performance" document

I think you might speed up your onDraw() method a little bit this way,
though I think you might not reach more than 30 or 35 FPS.
At first you should eliminate all function calls in your onDraw()
method. I know this is bad code style, but it really is faster. I am
drawing some bitmaps for a project here this way.
Second, you should create local variables for all attributes you use
more than once.
Third and most importantly: Remove unnecessary code. For example, you
call System.currentTimeMillis() relatively often (I think you used
this code for performance measuring, but anyway).

And last but not least: Android comes with a profiler. Try to use
it. :-)


Marc Reichelt   ||

> }

3. no sound from music players even when alsa is fully functional

4. Problem while sending unicode character via SMS

5. Notification sound from file inside the app package ?

6. Timer and Timer Task

7. program's offline installation