I have a code like this:
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();
}
My question is - where the cursorHistory shall be closed? Do I need to write a special handling for that, or is it closed automatically somewhere on cursor's finalization?