I have tried to built a simple music player in Android. My view for each song contains the SeekBar.
It works fine for me. Now I want the timer counting the seconds/minutes of a progress of a song. So I put the
TextView in a layout, get it with the
onCreate(), and put it in
run() after the
String mytime = String.format("%d:%d",
But the last line gives me below exception:
“android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.”
I am doing basically a same thing here as I am doing with my
SeekBar - creating a view in
onCreate, then just touching it in
run() – and then it doesn't give me any complaint.