 <p>You have not initialized <code>locationManager</code> To fix this, in your onCreate method you can do something like:</p> <pre><code>locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); </code></pre>