Android:cursor.close()在使用registerContentObserver时
使用时是否必须关闭光标Android:cursor.close()在使用registerContentObserver时,android,cursor,contentobserver,Android,Cursor,Contentobserver,使用时是否必须关闭光标 startManagingCursor(cursor); //I know its deprecated 及 如果是,在哪里关闭它?如果使用startManagingCursor您不需要关闭光标,Activity将为您解决此问题 但是如果您已经调用了registerContentObserver,则需要调用unregisterContentObserver。通常在OnResume中调用registerContentObserver,在OnPause中调用unregis
startManagingCursor(cursor); //I know its deprecated
及
如果是,在哪里关闭它?如果使用
startManagingCursor
您不需要关闭光标,Activity将为您解决此问题
但是如果您已经调用了registerContentObserver
,则需要调用unregisterContentObserver
。通常在OnResume中调用registerContentObserver,在OnPause中调用unregisterContentObserver,但它可能会根据您在ContentObserver
中执行的操作类型而变化
cursor.registerContentObserver(..