Home > Mobile >  Android how to judge whether to open the location permissions
Android how to judge whether to open the location permissions

Time:12-20

How to open location permissions directly

CodePudding user response:

LocationManager lm=(LocationManager) getSystemService (LOCATION_SERVICE);
Boolean ok=lm. IsProviderEnabled (LocationManager. GPS_PROVIDER);

If (ok) {
.
}

CodePudding user response:

reference 1/f, minimalist, please reply:
LocationManager lm=(LocationManager) getSystemService (LOCATION_SERVICE);
Boolean ok=lm. IsProviderEnabled (LocationManager. GPS_PROVIDER);

If (ok) {
.
}

Really useful!!!!!!!!!!!
  • Related