我有以下代碼,其中,我從sqlite數據庫中獲取數據。只要數據升級,我就能夠很好地獲取所有值,但無法升級存儲到StringBuilder中的值。因此,只要數據升級,StringBuilder就會顯示數據庫的第一個數據。StringBuilder相關問題
private void showData(Cursor cursor) {
StringBuilder stbuilder = new StringBuilder();
while(cursor.moveToNext())
{
start_time = cursor.getString(1);
end_time = cursor.getString(2);
duration_time = cursor.getString(3);
phone_option = cursor.getString(4);
phone_mode = cursor.getString(5);
stbuilder.append(start_time+" "+end_time+" "+duration_time+" "+phone_option+" "+phone_mode);
Log.i("STARTtttDB", ""+start_time);
Log.i("enddddDB", ""+end_time);
Log.i("duratonnn", ""+duration_time);
Log.i("OpTIONnnnn",""+phone_option);
Log.i("M O D E ",""+phone_mode);
String data=stbuilder.toString();
Log.i("Data OUtput",data);
}
你的意思是'更新'而不是'升級'?否則,這個問題對我來說是沒有意義的。 – Kevin 2011-03-03 15:53:07
對不起我的更新 – PiyushMishra 2011-03-03 15:54:38