SetProgressDrawable Android 2.3 not showing Bug


I tried to change progressDrawable color in Android 4.3 and it’s showing the exact results. But, this not happen in Android 2.3.3 which progressBar itself just dissapeared. Apparently, this is Android 2.3 bug and here is the solution :

1
2
3
4
Drawable colorDrawable = convertView.getResources().getDrawable(R.drawable.job_percentage_green);          
Rect bounds = holder.jobProgressBar.getProgressDrawable().getBounds();
holder.jobProgressBar.setProgressDrawable(colorDrawable);
holder.jobProgressBar.getProgressDrawable().setBounds(bounds);

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.