bar = (ProgressBar) findViewById(R.id.progress);
bar.setProgress(total);
int oneMin= 1 * 60 * 1000; // 1 minute in milli seconds
/** CountDownTimer starts with 1 minutes and every onTick is 1 second */
cdt = new CountDownTimer(oneMin, 1000) {
public void onTick(long millisUntilFinished) {
total = (int) ((timePassed/ 60) * 100);
bar.setProgress(total);
}
public void onFinish() {
// DO something when 1 minute is up
}
}.start();
i have edited the code. see it now. so how this works. first you set a total on the progress bar which in your case will be 60. then you need to calculate the percentage of how much time has passed since the start and that you get with timePassed/60*100 and casting it to int. so on every tick you increase the progress by 1/100 of the total size.
Hope this makes it more clear.