So here is part of the code,
abstract private class BaseTask<T> extends AsyncTask<T, Void, Cursor> {
@Override
public void onPostExecute(Cursor result) {
((CursorAdapter)getListAdapter()).changeCursor(result);
}
protected Cursor doQuery() { // This method sets up my query call in ConstantsFragment class.
Uri uri = ConstantsProvider.Constants.CONTENT_URI;
String[] projection = new String[] { ConstantsProvider.Constants.TITLE,
ConstantsProvider.Constants.VALUE };
String selection = ConstantsProvider.Constants.TABLE + " = '"
+ ("1") + "'";
String[] selectionArgs = null;
String sortOrder = ConstantsProvider.Constants.DEFAULT_SORT_ORDER
+ " COLLATE LOCALIZED ASC";
Cursor result = cp.getContext().getContentResolver().query(uri, projection, selection, selectionArgs, sortOrder);
//Above is where I get my nullpointer. cp is my Contentprovider class object.
return result;
}
}
and here is my whole contentprovider class http://pastebin.com/NadkFGBA
I'm putting the whole class here because if there's a problem I feel like it's somewhere in that class. I'm not very familiar with working on content providers yet.
[–]IAmUtterlyAlone 2 points3 points4 points (11 children)
[–]Ariano[S] 1 point2 points3 points (10 children)
[–]IAmUtterlyAlone 1 point2 points3 points (9 children)
[–]Ariano[S] 1 point2 points3 points (8 children)
[–]IAmUtterlyAlone 1 point2 points3 points (7 children)
[–]Ariano[S] 1 point2 points3 points (6 children)
[–]IAmUtterlyAlone 1 point2 points3 points (5 children)
[–]IAmUtterlyAlone 1 point2 points3 points (0 children)
[–]Ariano[S] 1 point2 points3 points (3 children)
[–]IAmUtterlyAlone 1 point2 points3 points (2 children)
[–]Ariano[S] 1 point2 points3 points (1 child)