content: package com.pomodoro.application.activity;
  
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.os.CountDownTimer;
  import android.view.View;
  import android.widget.Button;
  import android.widget.TextView;
  
  import com.pomodoro.application.R;
  
  import java.util.Locale;
  
  public class LongBreakTime extends AppCompatActivity {
  
      private static final long START_TIME_IN_MILLIS = 2000;
      private TextView mTextViewCountDown;
      private Button mButtonStartPause;
      private CountDownTimer mCountDownTimer;
      private boolean mTimerRunning;
      private long mTimeLeftInMillis = START_TIME_IN_MILLIS;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_long_break_time);
  
          mTextViewCountDown = findViewById(R.id.text_view_countdown);
          mButtonStartPause = findViewById(R.id.button_start_pause);
  
          mButtonStartPause.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  if (mTimerRunning) {
                      pauseTimer();
                  } else {
                      startTimer();
                  }
              }
          });
  
          updateCountDownText();
      }
  
      private void startTimer() {
          mCountDownTimer = new CountDownTimer(mTimeLeftInMillis, 1000) {
              @Override
              public void onTick(long millisUntilFinished) {
                  mTimeLeftInMillis = millisUntilFinished;
                  updateCountDownText();
              }
  
              @Override
              public void onFinish() {
                  mTimerRunning = false;
                  startActivity(new Intent(LongBreakTime.this, MainActivity.class));
              }
          }.start();
  
          mTimerRunning = true;
          mButtonStartPause.setText("Pause");
  
      }
  
      private void pauseTimer() {
          mCountDownTimer.cancel();
          mTimerRunning=false;
          mButtonStartPause.setText("Start");
      }
  
  
  
      private void updateCountDownText() {
          int minutes = (int) (mTimeLeftInMillis/1000)/60;
          int seconds = (int) (mTimeLeftInMillis/1000)%60;
  
          String timeLeftFormatted = String.format(Locale.getDefault(),"%02d:%02d", minutes, seconds);
          mTextViewCountDown.setText(timeLeftFormatted);
      }
  }