Пример #1
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    setRetainInstance(true);
    randomNumText.setOnClickListener(this);
    confirmationText.setOnClickListener(this);
    fizzImage.setOnClickListener(this);
    buzzImage.setOnClickListener(this);
    bothText.setOnClickListener(this);

    animateNewNumber();

    winsCountText.setText(
        activity.getString(R.string.wins) + PreferenceUtil.getCorrectAnswers(activity));
    lossesCountText.setText(
        activity.getString(R.string.losses) + PreferenceUtil.getIncorrectAnswers(activity));
  }
Пример #2
0
 private void addToIncorrectCount() {
   int previousIncorrectAnswers = PreferenceUtil.getIncorrectAnswers(activity);
   int currentIncorrectAnswers = ++previousIncorrectAnswers;
   PreferenceUtil.setIncorrectAnswers(activity, previousIncorrectAnswers++);
   lossesCountText.setText(activity.getString(R.string.losses) + currentIncorrectAnswers);
 }