@Override
  public void onHandEvent(HandEvent handEvent) {
    Log.i(TAG, "Ari " + handEvent.type);
    String eventType = handEvent.type.toString();

    if (eventType.equals("OPEN_HAND")) {
      playSuccessSound();
      if (foodItem.isLastStep()) {
        resetTraining();
      } else {
        mAri.stop();
        finish();
      }

    } else if (eventType.equals("CLOSED_HAND")) {
      playSuccessSound();
      if (foodItem.isLastStep()) {
        starGetIdActivity();
      } else {
        if (play) pauseTraining();
      }

    } else if (eventType.equals("V_SIGN")) {
      playSuccessSound();
      if (!play) startTraining();
    } else if (eventType.equals("LEFT_SWIPE")) {
      playSuccessSound();
      manualNextStep();

    } else if (eventType.equals("RIGHT_SWIPE")) {
      playSuccessSound();
      previousStep();
    }
  }
  @Override
  protected void onPause() {
    super.onPause();

    if (mAri != null) {
      mAri.stop();
    }
  }