如何从游标类数据 [英] How to retrieve data from cursor class

查看:134
本文介绍了如何从游标类数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道如何从游标检索数据。我需要这个,因为ringtonemanager返回游标对象的形式将所有音频文件,我需要知道如何检索值。

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。

推荐答案

一旦你的光标对象,你可以做这样的事情:

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(cursor.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.

再见!

这篇关于如何从游标类数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆