I'm making a basic media player that uses a cursor to query the
playlist members. It does everything fine, but I cannot figure out how
to play a song once I have it in a cursor.
mSongList =
Uri.withAppendedPath(ContentUris.withAppendedId(Playlists.EXTERNAL_URI,
playlistId), Members.CONTENT_DIRECTORY);
songsCursor = getContentResolver().query(mSongList, null,
null, null, null);
mSongId = songsCursor.getColumnIndex(Members.AUDIO_ID);
columnTitle = songsCursor.getColumnIndex(Members.TITLE);
columnArtist = songsCursor.getColumnIndex(Members.ARTIST);
int id = songsCursor.getColumnIndex(Members._ID);
mp = new MediaPlayer();
while(mSongsLeft >= 0)
{
nextSong();
//// THIS IS WRONG ??????
mSong = ContentUris.withAppendedId(mPlaylists,
songsCursor.getInt(mSongId));
//////
try
{
mp.setDataSource(this, mSong);
mp.start();
I just need the code to convert it into a proper uri or just get the
path...
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en