@Override
  protected void onResume() {
    super.onResume();

    status.setText(getString(R.string.waiting_for_location));
    status.setVisibility(View.VISIBLE);

    currentLocation = null;
    mapView.getController().setZoom(12);

    if (selectedStop == null) {
      status.setText(getString(R.string.waiting_for_location));
      status.setVisibility(View.VISIBLE);
      try {
        LocationService.registerForLocationUpdates(getApplicationContext(), this);

      } catch (NoProvidersException e) {
        status.setText(getString(R.string.no_location_providers));
        status.setVisibility(View.VISIBLE);
      }
    }

    FetchRouteStopsTask fetchRouteStopsTask =
        new FetchRouteStopsTask(
            new StopsService(
                ApiFactory.getApi(getApplicationContext()),
                new StopsCache(getApplicationContext()),
                getApplicationContext()));
    fetchRouteStopsTask.execute(selectedRoute);
  }
 @Override
 protected void onPause() {
   super.onPause();
   LocationService.turnOffLocationUpdates(this.getApplicationContext(), this);
 }