How to get last known location for Location manager in Android?
问题 I am using simple location manager object to get lastKnownLocation() of device but getting null object in return can any one tell me why ? Code : public Location getLocation() { LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); if (locationManager != null) { Location lastKnownLocationGPS = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if (lastKnownLocationGPS != null) { return lastKnownLocationGPS; } else { Location loc