设为首页收藏本站
开启辅助访问
切换到宽版

创星网络[分享知识 传递快乐]

 找回密码
 立即注册

QQ登录

只需一步,快速开始

用新浪微博登录

只需一步,快速搞定

搜索
查看: 3447|回复: 0
打印 上一主题 下一主题

Android Cursor遍历

[复制链接]

我玩的应用:

跳转到指定楼层
楼主
发表于 2012-12-11 23:20:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. public List<PointBean> getAllPoints() {
  2.                 String sql = "select * from points";
  3.                 SQLiteDatabase db = helper.getWritableDatabase();
  4.                 List<PointBean> pointList = new ArrayList<PointBean>();
  5.                 PointBean point = null;
  6.                 Cursor cursor = db.rawQuery(sql, null);
  7.                 while (cursor.moveToNext()) {
  8.                         point = new PointBean();
  9.                         point.setPointName(cursor.getString(cursor
  10.                                         .getColumnIndex("point_name")));
  11.                         point.setLongitude(cursor.getDouble(cursor
  12.                                         .getColumnIndex("longitude")));
  13.                         point.setLatitude(cursor.getDouble(cursor
  14.                                         .getColumnIndex("latitude")));
  15.                         pointList.add(point);
  16.                 }
  17.                 return pointList;
  18.         }
复制代码
from:http://go.cxweb.com.cn/dv03g
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播 分享分享 分享淘帖
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|创星网络 ( 苏ICP备11027519号|网站地图  

GMT+8, 2024-9-22 06:43 , Processed in 0.080899 second(s), 27 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表