How can you dynamically update the color of a SeekBar?

android

Solution

I think this is what you are looking for

This can be achived by creating custom drwables for background and progress of seak bar See this link for sample code.

Pls see the below links also http://javatechig.com/android/android-seekbar-example/

Change the color of a seekbar on onProgressChanged

Problem

I would like to have the color of the progress bar (specifically the secondary progress that is updated with setSecondaryProgress) to change dynamically at runtime when it crosses a certain point. I am already able to substitute my own drawable into the bar during my Activity's onCreate function (changing color from yellow to green) by calling setProgressDrawable and substituting a resource I've copied from the default Android version of a horizontal progress (SDK/platforms/android-2.1/data/res/drawable/progress_horizontal.xml). However, updating this at runtime (yes, from the UI thread via an AsyncTask) causes the entire progress bar except for the thumbtab to go black or transparent.

Original source

Related problems