I'm using a FilterQueryProvider to filter the content of a list view which is backed up by a custom CursorAdapter.
To use the FilterQueryProvider you have to override the runQuery() method which returns a Cursor object. Now I'm wondering how to query for the cursor asynchronously to avoid blocking the UI thread.
Is there some kind of best practice? I couldn't find any information whether the the runQuery() method is executed on the UI-thread or on its own thread.
From the documentation :
So your code should look like this :
Sources : this and this
According to CursorAdapter documentation you can use
CursorAdapter#runQueryOnBackgroundThread