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
Use this code, and no need to runOnUiThread
function:
private Handler handler;
private Runnable handlerTask;
void StartTimer(){
handler = new Handler();
handlerTask = new Runnable()
{
@Override
public void run() {
// do something
textView.setText("some text");
handler.postDelayed(handlerTask, 1000);
}
};
handlerTask.run();
}