Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- locationManager = (LocationManager) getApplicationContext().getSystemService(LOCATION_SERVICE);
- isGPSEnabled = locationManager
- .isProviderEnabled(LocationManager.GPS_PROVIDER);
- isNetworkEnabled = locationManager
- .isProviderEnabled(LocationManager.NETWORK_PROVIDER);
- if(!isGPSEnabled) {
- startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));
- }
- if(!isNetworkEnabled) {
- startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement