title: android location getting null need solution
body: <pre><code>String logloc ="";
  LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); 
  Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
  if (location!=null) {
      double longitude = location.getLongitude();
      double latitude = location.getLatitude();
      logloc = String.valueOf(latitude)+","+String.valueOf(longitude);
      notfi(logloc); 
  }
  </code></pre>
  
  <p>in this above code my location is always getting null even my gps device is on and both outside the building and inside the building , i'm getting null value only , kindly help me run this code </p>