Receiving a NullPointerException when calling a cursor in Android

Posted by LordSnoutimus on Stack Overflow See other posts from Stack Overflow or by LordSnoutimus
Published on 2010-03-18T18:30:09Z Indexed on 2010/03/18 18:51 UTC
Read the original article Hit count: 300

Filed under:
|
|
|
|

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.

© Stack Overflow or respective owner

Related posts about android

Related posts about java