【发布时间】:2017-05-19 23:46:02
【问题描述】:
我有这样的代码:
void showHistory(final long alertid) {
final View view = getLayoutInflater().inflate(R.layout.dialog_history, null);
ListView listView = (ListView) view.findViewById(R.id.list_history);
final Cursor cursorHistory = helper.getHistory(alertid);
CursorAdapter cursorAdapter = new HistoryAdapter(this,cursorHistory);
listView.setAdapter(cursorAdapter);
new AlertDialog.Builder(this)
.setTitle("History")
.setView(view)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
})
.show();
}
我的问题是 - cursorHistory 应该在哪里关闭?我是否需要为此编写特殊处理,还是在光标完成时自动关闭?
【问题讨论】:
标签: android