Hi All,
As part of my basic mp3 player, I'm using the inbuilt media player to play
songs. The problem I'm facing is that, though I'm able to get "TITLE" but
during playing the song, when I query for "DATA" field as below ( the full
code for quick viewing is give below.)
*private void playSong(int position) {*
* try {*
* int column_index = mCursor*
* .getColumnIndexOrThrow(MediaStore.Audio.Media.DATA);*
* mCursor.moveToPosition(position);*
* String filename = mCursor.getString(column_index);*
* Log.v(TAG, "Current Title:" + mCursor.getString(column_index));*
* if (mp.isPlaying()) {*
* mp.reset();*
* }*
* mp.setDataSource(filename);*
* mp.prepare();*
* mp.setOnCompletionListener(new OnCompletionListener() {*
* // Setup listener so next song starts automatically*
* @Override*
* public void onCompletion(MediaPlayer arg0) {*
* nextSong();*
* }*
* });*
* mp.start();*
* } catch (Exception e) {*
* Log.e(TAG, "Exception in playsong():" + e.getMessage());*
* }*
* }*
its giving me the following errors:
09-27 21:29:30.980: ERROR/Mp3Player(633): Exception in playsong():*column
'_data' does not exist*
Is there any way, I can get around with this and still play these mp3 files.
The mp3 files I'm using are the ones commonly available on the web and might
be missing the metadata.
Any help would be appreciated.
Thanks,
KK
--
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