I´m changing my application to use CursorLoader instead of startManagingCursor....
And I have one AutoCompleteTextView, SimpleCursorAdapter and in my setFilterQueryProvider implementation, in "runQuery" method I have
mProdutoAdapter.setFilterQueryProvider(new FilterQueryProvider() {
@Override
public Cursor runQuery(CharSequence constraint) {
Cursor cursor = mVendasDb.getProdutos(constraint.toString());
startManagingCursor(cursor);
return cursor;
}
});
How can I change this part to make it works with CursorLoader?
Should I discard setQueryFilterProvider and use TextWatcher in the AutocompleteTextView and then call getLoaderManager().restartLoader(0, bundleFilter, this)??? I have no idea how to proced!
bundleFilter would have the text came from textwatcher.
Is it ok using this aproach? Is it the best to do in this case?