我在 android 中有这个数据库打印机。
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);
}
}
应该可以,我会说。
关于java - Android光标获取下一个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18278333/