我在Score.xml中的后退按钮不起作用,虽然我已经把finish()放入其中。但它适用于我的其他按钮。我的logcat中出现了这个错误:
04-13 00:27:23.459:E / Cursor(312):完成尚未停用或关闭的光标。 database = /data/data/com.memes/databases/dbemp.sqlite,table = score,query = SELECT score,difficulty,date FROM score ORDER BY score desc LIMIT 15
这是我在DBFunctions.java中的方法,是否将cursor.close()放在正确的位置?
public String getScore() {
// TODO Auto-generated method stub
String[] columns = new String[]{"score", "difficulty", "date"};
Cursor c = db.query(tableScore, columns, null, null, null, null, "score desc", "15");
String result = "";
int iScore = c.getColumnIndex("score");
int iDifficulty = c.getColumnIndex("difficulty");
int iDate = c.getColumnIndex("date");
for(c.moveToFirst(); !c.isAfterLast(); c.moveToNext()){
result = result + " " + c.getString(iScore) + " " + c.getString(iDifficulty) + " " + c.getString(iDate) +"\n";
}
c.close();
return result;
}