0

I have a progress bar that counts backwards. When show value 0 stop The countdown will be stopped. In my qestion how do resume countdown in progress bar. This code show progress bar with countdown.

new Thread(new Runnable() {

        @Override
        public void run() {
            progressBar.setMax(progressStatus);


            while (progressStatus > 0) {
                progressStatus -= 1;
                handler.post(new Runnable() {
                    @Override
                    public void run() {
                        progressBar.setProgress(progressStatus);
                        secondTimeTextView.setText(String.valueOf(progressStatus));
                    }
                });
                try {
                    Thread.sleep(1000);

                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }


        }
    }).start();  
Ewelina
  • 69
  • 1
  • 10

1 Answers1

0

If i understand it correctly this is what you want.

How can I reset the Progressbar?

ProgressBar.setProgress(0)

Just set your Progress manually from 1..100

Community
  • 1
  • 1
Ice
  • 50
  • 1
  • 10