Rakesh Rakesh - 2 years ago 128
Android Question

How to retrieve data from cursor class

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.


Answer Source

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

if (cursor.moveToFirst()){
      String data = cursor.getString(cursor.getColumnIndex("data"));
      // do what ever you want here
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download