title: Getting 0.0 for latitude and longitude while showing current location in map
body: <p>I am using the following code to get my current location. But the problem I am facing is, it always returns 0.0 for latitude and longitude. I have turned on the GPS settings in the phone and set all the permissions. But still I am facing this.</p>
  
  <pre><code>locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
  
  customLocationListener = new CustomLocationListener();
  
  locationManager.requestLocationUpdates(
  
          LocationManager.GPS_PROVIDER,
  
          0,
  
          0,
  
          customLocationListener);
  
  class CustomLocationListener implements LocationListener{ ............
  
        public void onLocationChanged(Location argLocation) { 
  
           if(location != null) {     
  
          int latitude=(int)(argLocation.getLatitude()*1E6);   
  
          int longitude=(int)(argLocation.getLongitude()*1E6);
  
  
                }
         } ........ }
  </code></pre>
  
  <p>Do any one of you know why?</p>
  
  <p>Note : My activity extends MapActivity not Location Listener</p>