title: how to solve Null pointer exception on Getting latitude or GPS?
body: <p>I am trying to get current long, lat. I am getting a Nullpointer on 
  <code>LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);</code></p>
  
  <pre><code>    LocationListener myLocationListener = new CurrentLocationListener(); 
      locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1, 1, myLocationListener);
      Location currentLocation = locationManager.getLastKnownLocation("gps"); 
      Latitude = currentLocation.getLatitude();  -----&gt;&gt;&gt; null pointer exception here
      Longitude = currentLocation.getLongitude();
  
  public class CurrentLocationListener implements LocationListener{
      public void onLocationChanged(Location argLocation) {
      }
      public void onProviderDisabled(String provider) {
      }
      public void onProviderEnabled(String provider) {
      }
      public void onStatusChanged(String provider, int status, Bundle arg2) {
      }
  } 
  </code></pre>
  
  <p>My manifest file</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"&gt;&lt;/uses-permission&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"&gt;&lt;/uses-permission&gt;
  </code></pre>