I\'ve built a simple music player in Android. The view for each song contains a SeekBar, implemented like this:
public class Song extends Activity implement
Usually, any action involving the user interface must be done in the main or UI thread, that is the one in which onCreate()
and event handling are executed. One way to be sure of that is using runOnUiThread(), another is using Handlers.
ProgressBar.setProgress()
has a mechanism for which it will always execute on the main thread, so that's why it worked.
See Painless Threading.