开发者

Seekbar timing on Android

I have an mediaplayer with seekbar. And the seekbar works fine. My problem is, I need to show the progressing time at the beginning开发者_运维知识库 of the seekbar, and remaining time at the end of the seekbar in a textview. Any suggestions.


Im not sure i really understand how you want it. But if you have a seekbar with a set maximum to the end time, and this is moving during the song/video/whatever you could just call mySeekBar.getProgress(). Otherwise if you have a onSeekBarChangedListener you get the progress from the implemented method. Otherwise just just use System.currentTimeMillis() at the beggining and subtract the current time with the start time each time the seekbar changes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜