title: Receiving a NullPointerException when calling a cursor in Android
body: <p>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. </p>
  
  <p>I am able to create the cursor using this line of code: </p>
  
  <pre><code>Cursor c = getContentResolver().query(GPSContentProvider.CONTENT_URI,
                                                        null, null, null, null);
  startManagingCursor(c);
  </code></pre>
  
  <p>However, when I make a call to move to the first row in the database or even try to close the cursor using <code>c.close();</code> I receive a <code>NullPointerException</code>. </p>
  
  <p>Edit: Just to make it clear, I can store the longitude, latitude and time in milli's within the database, the problem is then taking the data out of the database and displyaing this on a map.</p>
  
  <h3>Updated code:</h3>
  
  <pre><code>public static final String AUTHORITY = "application.android.prototype";
  // followed by the CONTENT_URI
  public static final Uri CONTENT_URI = Uri.
                      parse("content://" + AUTHORITY + "/gpspoints");
  </code></pre>
  
  <h3>Updated permissions:</h3>
  
  <pre><code>&lt;provider android:name="GPSDataContentProvider" android:authorities="application.android.prototype"&gt;
  &lt;/provider&gt;
  </code></pre>