sqlite db에서 제공하는 listview가 있습니다. 필자는 여러 다른 지점에서 fillData()를 호출하여 listview를 업데이트합니다.Close가 명시 적으로 호출되지 않았습니다.
private void fillData() {
mDbHelper.open();
Cursor c = mDbHelper.fetchAllNotes(table, columns, selection, selectionArgs, null, null);
startManagingCursor(c);
String[] from = new String[] { "quantity", "color", "style" };
int[] to = new int[] { R.id.textQuantity, R.id.textColor, R.id.textStyle };
setListAdapter(new SimpleCursorAdapter(this, R.layout.recordrow, c, from, to) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = super.getView(position, convertView, parent);
return v;
}
});
}
그건 ... 문제는, 내가 열거 나 닫을 때/활동을 뛰어 넘을 때, 나는 logcat에서 오류가 발생합니다. 그것은 비록 프로그램을 충돌하지 않습니다. 오류는 다음과 같습니다
가 명시 적으로
및
가까운()를 명시 적으로
그래서 아래}) 데이터베이스에 호출되지 않았다 close()를 커서에 전화 확인하십시오; mDbHelper.close()를 넣으면 데이터베이스가 열리지 않는다는 충돌이 발생합니다. c.close()를 넣으면 listview가 채워지지 않습니다. 나는 여러 다른 장소에 넣어 봤는데 그것은 나에게 커서/데이터베이스가 이미 닫힌 말하는 오류를 제공합니다. 무엇에 관한 아이디어가 있습니까?
시작하기 만하면 startManagingCursor 메소드가 사용되지 않습니다. 그것을 제거한 다음 mDbHelper.close()를 뒤에 두는 것이 좋습니다.}); – chaitanya
그럴 경우 listview가 채워지지만 여러 개의 '비활성화되거나 닫히지 않은 커서 마무리'오류가 발생합니다. – Roger