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();
我想知道如何在循环中获得下一个速度?
答案 0 :(得分:6)
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);
}
}
应该有用,我会说。