Skip to content

Instantly share code, notes, and snippets.

@pkavoo
Created April 2, 2020 21:39
Show Gist options
  • Save pkavoo/9388acb6fcaea8bacc7211dc692a832c to your computer and use it in GitHub Desktop.
Save pkavoo/9388acb6fcaea8bacc7211dc692a832c to your computer and use it in GitHub Desktop.
Method for checking if GPS is enabled
public boolean isGPSEnabled(Context mContext) {
LocationManager locationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment