I have an android app with a timer. By default, it is displayed as 00:00:00 (Hours, Minutes, Seconds). The user can press the H M S and drag the scrubber around the circle to change the hour, minute, or second, depending on which one is clicked. I am trying to create a CountDownTimer by parsing the number from the changeable TextViews for hours, minutes, and seconds, convert it all into seconds, and then start the timer; however, the problem is that is displays the total minutes instead of keeping it 59 and below. For example if I countdown for 3 hours. It displays 2 Hours, 179 Minutes and 59 Seconds. When I want it to be 2 Hrs. 59 Minutes, 59 Seconds. 

![enter image description here](https://i.stack.imgur.com/Ml24M.png)

I am not sure why I am receiving this error. I am getting all the right values in my code.

Here is my code for the setActionListener for my CountDownTimer in my class, I made a comment for where I think the error might be.:

```
private void setActionListeners() {

    number_text = (TextView) findViewById(R.id.hour_progress_number);
    minute_text = (TextView) findViewById(R.id.minute_progress_number);
    second_text = (TextView) findViewById(R.id.second_progress_number);

    start_timer.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {

           // textViewShowTime.setTextAppearance(getApplicationContext(), R.style.normalText);

            hourint = Integer.valueOf(number_text.getText().toString());

            minuteint = Integer.valueOf(minute_text.getText().toString());

            secondint = Integer.valueOf(second_text.getText().toString());

            Log.i("YourActivity", "Hours: " + hourint);

            Log.i("YourActivity", "Minutes: " + minuteint);

            Log.i("YourActivity", "Seconds: " + secondint);

            totalTimeCountInMilliseconds = ((hourint*60*60) +(minuteint*60) + (secondint)) * 1000;      // time count for 3 minutes = 180 seconds
            timeBlinkInMilliseconds = totalTimeCountInMilliseconds/1000;

            countDownTimer = new CountDownTimer(totalTimeCountInMilliseconds, 500) {
                // 500 means, onTick function will be called at every 500 milliseconds

                @Override
                public void onTick(long leftTimeInMilliseconds) {
                    long seconds = leftTimeInMilliseconds / 1000;
                    mSeekArc.setVisibility(View.INVISIBLE);

                    if ( leftTimeInMilliseconds < timeBlinkInMilliseconds ) {
                       // textViewShowTime.setTextAppearance(getApplicationContext(), R.style.blinkText);
                        // change the style of the textview .. giving a red alert style

                        if ( blink ) {
                            number_text.setVisibility(View.VISIBLE);
                            minute_text.setVisibility(View.VISIBLE);
                            second_text.setVisibility(View.VISIBLE);

                            // if blink is true, textview will be visible
                        } else {
                            number_text.setVisibility(View.INVISIBLE);
                            minute_text.setVisibility(View.INVISIBLE);
                            second_text.setVisibility(View.INVISIBLE);

                        }

                        blink = !blink;         // toggle the value of blink
                    }

                    second_text.setText(String.format("%02d", seconds % 60));  

                    //THE ERROR MIGHT BE HERE FOR THE MINUTE
                    minute_text.setText(String.format("%02d", seconds / 60));

                    number_text.setText(String.format("%02d", seconds / 3600));                     // format the textview to show the easily readable format
                }

                @Override
                public void onFinish() {
                    // this function will be called when the timecount is finished
                    //textViewShowTime.setText("Time up!");
                    number_text.setVisibility(View.VISIBLE);
                    minute_text.setVisibility(View.VISIBLE);
                    second_text.setVisibility(View.VISIBLE);
                    mSeekArc.setVisibility(View.VISIBLE);
                }

            }.start();

        }
    });

```

I have tried tampering around with that value and finding its value for a while, but it is a really persistent problem and just won't display properly.

It seems like I am doing everything correctly:

[Countdown timer in HH:MM:SS format in Android](https://stackoverflow.com/questions/15404143/countdown-timer-in-hhmmss-format-in-android)

What exactly is the problem and how can it be fixed?

Here is my full code for the class if needed:

<http://pastebin.com/yquQPtG5>