我有一台安卓系统的数据库打印机。
Cursor curTAB = myDataBase.rawQuery("SELECT * FROM GPS_Values;", null);
Integer count = 0;
while (curTAB.moveToNext()) {
String s_latitude = curTAB.getString(1);
String s_longitude = curTAB.getString(2);
String s_speed = curTAB.getString(5);
count++;
String next_speed = ???
}
curTAB.close();
myDataBase.close();
我想知道如何获得下一个速度在环?
最佳答案
while (curTAB.moveToNext()) {
String s_latitude = curTAB.getString(1);
String s_longitude = curTAB.getString(2);
String s_speed = curTAB.getString(5);
count++;
int position = curTAB.getPosition();
if(curTAB.moveToNext()) {
String next_speed = curTAB.getString(5);
curTAB.moveToPosition(position);
}
}
我觉得应该有用。