I am changing the application to use CursorLoader instead of startManagingCursor ....
And I have one AutoCompleteTextView, SimpleCursorAdapter and in my implementation of setFilterQueryProvider, in the "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 work with CursorLoader?
Should I discard setQueryFilterProvider and use TextWatcher in AutocompleteTextView and then call getLoaderManager (). restartLoader (0, bundleFilter, this) ??? I have no idea how to proceed!
bundleFilter will have text retrieved from textwatcher.
Can this approach be used? Is it better to do this in this case?
source share