Lets say that 5 stars or full progressBar would be when counter2 reaches 300 (counter2 (workout sets completed))
You already set the correct progress for the ProgressBar
but you also increment the newly set progress again(by the counter value) which will not show the proper results. In the onCreate
method:
bar.setMax(300);
bar.setProgress(counter2); // the initial stored value
and in the listeners for the buttons:
case R.id.baddset:
counter2 += 1;
display2.setText(String.valueOf(counter2));
add2.startAnimation(a);
bar.setProgress(counter2);
break;
case R.id.bsubset:
counter2 -= 1;
display2.setText(String.valueOf(counter2));
sub2.startAnimation(a);
bar.setProgress(counter2);
break;