@Override
  protected void onStop() {
    AppLog.log("Unregistering event listener");

    app.getSensorManager().unregisterListener(this);

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

    AppLog.log("Registering event listener");

    app.getSensorManager()
        .registerListener(
            this, app.getSensorList().get(sensorIndex), SensorManager.SENSOR_DELAY_UI);
  }