locationManager.getLastKnownLocation() null zurück

ich verstehe nicht, warum locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); Gegenzug die Position null. Ich gab allen die Erlaubnis, aber seine reutning null.

          if (isGPSEnabled) {
            if (location == null) {
                locationManager.requestLocationUpdates(
                        LocationManager.GPS_PROVIDER,
                        MIN_TIME_BW_UPDATES,
                        MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
                Log.d("GPS", "GPS Enabled");
                if (locationManager != null) {
                    location = locationManager
                            .getLastKnownLocation(LocationManager.GPS_PROVIDER);
                    if (location != null) {
                        latitude = location.getLatitude();
                        longitude = location.getLongitude();
                    }
                }
            }
        }

InformationsquelleAutor der Frage user3291590 | 2014-05-28

Schreibe einen Kommentar