Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. locationManager = (LocationManager) getApplicationContext().getSystemService(LOCATION_SERVICE);
  2. isGPSEnabled = locationManager
  3. .isProviderEnabled(LocationManager.GPS_PROVIDER);
  4. isNetworkEnabled = locationManager
  5. .isProviderEnabled(LocationManager.NETWORK_PROVIDER);
  6.  
  7. if(!isGPSEnabled) {
  8. startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));
  9. }
  10. if(!isNetworkEnabled) {
  11. startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS));
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement