@Override public void onPause() { super.onPause(); // stop geolocation if (mGeolocation != null) mGeolocation.stop(); }
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); // start geolocation if (mLocation == null) { mGeolocation = null; mGeolocation = new Geolocation( (LocationManager) getActivity().getSystemService(Context.LOCATION_SERVICE), this); } }