Home > Not Working > Android Current Location Not Working

Android Current Location Not Working


Location location = null; if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); } else { // requestPermissions(new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 0); Toast.makeText(this, "Should ask for the approval/denial here", Toast.LENGTH_LONG).show(); } Reply Faye I generally try to abstract such things into separate objects. Removing Updates When Finished Just like we have to disconnect our client, we also need to explicitly remove location updates after requesting them. Can't say I'm not disappointed with the features in the phone vs the marketed information, especially htcsense.com.Click to expand... http://pgelections.com/not-working/android-location-services-not-working.html