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.
精彩评论