Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why it is discouraged to use autoRequery in CursorAdapter?

Tags:

android

There is a constructor for the CursorAdapter which has an interesting flag - autoRequery.

It is stated:

If true the adapter will call requery() on the cursor whenever it changes so the most recent data is always displayed. Using true here is discouraged.

What's the point to create the feature which is discouraged?

like image 200
Eugene Avatar asked Nov 01 '22 07:11

Eugene


1 Answers

As per the Docs it is discouraged because it results in Cursor operations to be performed on the application's UI thread

Because of this it causes Performance Issue for the App

Well To add more ...Other Solution for This is Using swapCursor()

Solution:

CursorDemo cursorDemo = new CursorDemo(PrintContent.this, cursor);

cursorDemo.swapCursor(cursor_update);
like image 179
Nitesh Tiwari Avatar answered Nov 12 '22 20:11

Nitesh Tiwari