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();