Android MediaController歌曲结束 [英] Android MediaController End Of song

查看:158
本文介绍了Android MediaController歌曲结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个播放服务,正在后台任务中播放音频.我让MediaController在处理播放UI的播放器窗口"中控制音频的播放.

I have a play service that is playing audio in background task. I am letting MediaController control the playback of the audio in a "player window" which handles the playback UI.

一切正常,除非歌曲结束.播放器不会像我希望的那样重置".我希望进度条恢复为0,暂停/播放按钮恢复为播放状态.

All works fine except then the song gets to the end. The player does not "reset" as I would like it to. I want the progress bar to return to 0 and the pause/play button to revert back to play.

我可以通过调用mediaPlayer.seekTo(0)来使进度条返回0.如何让MediaController重新将暂停/播放按钮重置为显示播放按钮?

I can get the progress bar to return to 0 with a call to mediaPlayer.seekTo(0); How do I get the MediaController to reset the pause/play button back to show the play button?

推荐答案

因此,音频结束后的show(0)可以正确地重新显示UI.感谢Cylon的帮助!

So it turns out that show(0) after the audio has ended, re-displays the UI correctly. Thanks Cylon for the help!

这篇关于Android MediaController歌曲结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆