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. SQLite, android_metadata

Hi fellow developers,

I have created an SQLite database on another (non-android) system and
have transferred it to my SDCard so that my application can use its
data, however I have a problem where Android is expecting some custom
tables to exist, as when I call SQLiteDatabase.openDatabase() I get
the following exception:

12-11 16:49:49.107: ERROR/Database(241): SELECT locale FROM
android_metadata failed
12-11 16:49:49.214: ERROR/Database(241): Failed to setLocale() when
constructing, closing the database
12-11 16:49:49.214: ERROR/Database(241):
android.database.sqlite.SQLiteException: no such table:
12-11 16:49:49.214: ERROR/Database(241):     at
android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
12-11 16:49:49.214: ERROR/Database(241):     at
12-11 16:49:49.214: ERROR/Database(241):     at
12-11 16:49:49.214: ERROR/Database(241):     at

I obviously need to create the android_metadata table within the
database before I can copy it to my android device, but does any one
know the schema of this table?

Are there any other tables that I will need to create in order for
Android to be able to work with externally-created sqlite databases?

Any help is much appreciated.



2. Can we have PACKAGE_ADDED and CHANGED back?

In my view, it would be good to have the ability for an app to be
notified when it is installed. For apps that work in real-time like
when a call comes in, or an SMS or email comes in, and that need some
pre-setup to have taken place (like creating a database), it would be
very useful to be able to do this initialization right after install.
Asking the user to go through a manual setup process before first
(automatic) use is not appealing. Again, I'm talking about apps which
are not manually & explicitly exercised by users but whose value comes
from executing when certain actions take place on the device.

I see from..

3. Make it easier to add to contacts

4. Street View integration needs some work

5. Home key in G1 does not work

6. No way to see real "Debug and Test Settings on the Device"

7. Canvas.drawBitmap(int[] colors, ...) creates wrong alpha blending