开发者

Android: Synchronize Chronometer with MediaPlayer

I'm using SeekBar in my application and when user seeks it should reset teh chronometer apporpriately.

I wrote th开发者_开发问答e code as below.

chronometer.setBase(SystemClock.elapsedRealtime());
chronometer.setBase((mediaPlayer.getCurrentPosition()));

but it didn't help. chronometer shows like 2:48:00, which is very big and unrealistic for a 2:00 file.

Can someone help me with this please.

Thanks in advance.


can you try this

chronometer.setBase(SystemClock.elapsedRealtime() - mediaPlayer.getCurrentPosition());

and tell me what happens.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜