Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用时是否必须关闭光标
startManagingCursor(cursor); //I know its deprecated
和
cursor.registerContentObserver(..
如果是这样,在哪里关闭它?
如果使用startManagingCursor您不需要关闭光标,Activity 会为您处理。
startManagingCursor
但如果你已经打电话registerContentObserver,你需要打电话unregisterContentObserver。通常您在 OnResume 中调用 registerContentObserver 并在 OnPause 中调用 unregisterContentObserver,但它可能会根据您执行的操作类型而改变ContentObserver。
registerContentObserver
unregisterContentObserver
ContentObserver