Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onPause()
- {
- super.onPause();
- // Save batterylife by not aquiring location data when paused
- LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
- locationManager.removeUpdates(mLocationListener);
- }
- @Override
- public void onResume()
- {
- super.onResume();
- // Resume getting location updates
- LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
- locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, mLocationListener);
- }
Add Comment
Please, Sign In to add comment