tags:

views:

55

answers:

2

I need to know how to retrieve data from cursor. I need this because the ringtonemanager returns all the audio files in form of cursor object, I need to know how to retrieve the values.

Anbudan.

+3  A: 

Just read the documentation in the API:

http://developer.android.com/reference/android/database/Cursor.html

Or there is a nice tutorial:

http://developer.android.com/guide/tutorials/notepad/index.html

Also this question could maybe help you:

http://stackoverflow.com/questions/903343/cursor-get-the-field-value-android

Roflcoptr
+1  A: 

Once you have the Cursor object, you can do something like this:

if (cursor.moveToFirst()){
   do{
      String data = cursor.getString(cursor.getColumnIndex("data");
      // do what ever you want here
   }while(moveToNext());
}
cursor.close();

By the way... you should consider accepting some rate. I see you have received great answers to some of your questions, why don't you accept some of them. If you are not convinced with those answers, you could try to answer your own question just in case you want to contribute to the community.

Bye!

Salvador