@Override
  public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    if (savedInstanceState == null) {
      return;
    }

    mMask = savedInstanceState.getInt(STATE_MASK, 0);
    if (mIsPlaying) {
      mButtonShowSolution.setVisibility(View.GONE);
    }
    printQuestion();
  }
  @Override
  public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    if (savedInstanceState == null) {
      return;
    }

    if (mIsPlaying) {
      mSolution.setVisibility(View.GONE);
    }

    mCurrentQuestion = savedInstanceState.getInt(STATE_CURRENT_QUESTION);
    updateQuestionText();
  }
 @Override
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putInt(STATE_MASK, mMask);
 }
 @Override
 protected void endGame() {
   super.endGame();
   updateToTrainMode();
 }
 @Override
 public void cancelGame() {
   super.cancelGame();
   updateToTrainMode();
 }
 public void startGame() {
   super.startGame();
   updateToGameMode();
 }
  @Override
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putInt(STATE_CURRENT_QUESTION, mCurrentQuestion);
  }