对于CursorAdapter我由于没有使用过。不知道Cursor在那关闭。那一段时间比较抵触使用。
最近由于必须使用。所以去源码中寻找。
发现方法
/**
* Change the underlying cursor to a new cursor. If there is an existing cursor it will be
* closed.
*
* @param cursor The new cursor to be used
*/
public void changeCursor(Cursor cursor) {
Cursor old = swapCursor(cursor);
if (old != null) {
old.close();
}
}
注释也写了。changeCursor(null)的话就会去关闭cursor。