Android is complaining that the code below needs to call Looper.prepare. I have tried adding Looper.prepare but the code crashes after the sixth execution, leading me to believe that it wasn't as simple as I thought. Any suggestion would be appreciated. Incidentally I wrapped this code in AsyncTask cause I needed a progress spinner while the query was being executed. If there is something simpler, please let me know.
private class doSearch extends AsyncTask<String, String, Cursor> {
@Override
protected Cursor doInBackground(String... searchstring) {
[...]
CursorLoader loader = new CursorLoader(SearchActivity.this, codes, projection, mWhere, null, null);
Cursor cursor = loader.loadInBackground();
return cursor;
}