Receiving a NullPointerException when calling a cursor in Android
- by LordSnoutimus
I am creating an application which tracks the users location using GPS, stores the longitude and latitude in a database using a content provider then output the first long and lat to a mapview.
I am able to create the cursor using this line of code:
Cursor c = getContentResolver().query(GPSContentProvider.CONTENT_URI,
null, null, null, null);
startManagingCursor(c);
However, when I make a call to move to the first row in the database or even try to close the cursor using c.close(); I receive a NullPointerException.