سؤال

Do i have to close a cursor when using

 startManagingCursor(cursor); //I know its deprecated

and

cursor.registerContentObserver(..

if so, where to close it?

هل كانت مفيدة؟

المحلول

If using startManagingCursor you do not need to close the cursor, Activity will take care of that for you.

But if you have called registerContentObserver , you need to call unregisterContentObserver. Usually you call registerContentObserver in OnResume and unregisterContentObserver in OnPause, But it can change depending upon what kind of operations you are performing in ContentObserver.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top