I am trying to create a smooth progressbar with a countdown timer. I want the timer will countdown upto 20 sec.I am using the below code but I unable to achieve the smooth decending of the progressbar. Countdown tick function is working fine with the progressbar, but not in case of smooth behaviour. I found the below code from stackoverflow which i used in my project, but can you tell me what i am doing wrong.
if(android.os.Build.VERSION.SDK_INT >= 11){
// will update the "progress" propriety of seekbar until it reaches progress
ObjectAnimator animation = ObjectAnimator.ofInt(progressBarTimer, "progress", 0, 500);
animation.setDuration(20000); // 0.5 second
animation.setInterpolator(new LinearInterpolator());
animation.start();
}
else
progressBarTimer.setProgress(100);