我在数据库项目中有 6 条记录。For 循环读取每条记录,然后检查转换到动态数组的结果。但是For循环不能一直持续到最后!For循环检查第三条记录!
int count = db.count_field("location", "id");
geoAttrs = new ArrayList<StructureGeo>();
StructureGeo geo = new StructureGeo();
for (int i = 0; i < count; i++) {
geo.lat = db.get_lat("location", i);
geo.lang = db.get_log("location", i);
geo.result = gps2m(latitude, longitude, geo.lat, geo.lang);
geoAttrs.add(geo);
Log.i("LOG", "Array Index #" + i + " = " + geoAttrs.get(i));
}
db.close();
}
编辑 :
之后的吐司代码:
int count = db.count_field("location", "id");
结果: