Android 广播应用程序设计
我正在构建一个广播流应用程序,并且想知道后退和主页按钮的良好设计是什么。
返回按钮是否应该停止播放音乐并退出应用程序?主页按钮是否应该允许在后台播放音乐?有什么建议吗?
I am building a radio streaming app and was wondering what would be a good design for the back and home buttons.
Should the back button stop playing the music and quit the app? Should the home button allows the music to play in the background? Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为最好的设计是不要覆盖后退按钮和主页按钮的默认行为。
当游戏开始时,我的播放器会在通知区域中放置一个粘性通知,并带有一个小的持续播放箭头。当您单击通知时,它会将您带到无线电控件,以便您可以停止/暂停音频。这样,用户可以使用主页或返回键离开应用程序,并且您不必执行花哨的生命周期操作来管理无线电的状态。
The best design in my mind is not to override the default behavior of the back and home buttons.
My player puts a sticky notification into the notification area when play starts with a little persistent play arrow. When you click on the notification, it brings you to the radio controls so you can stop/pause the audio. This way, the user can leave the app using either the home or back key and you don't have to do fancy life cycle stuff to manage the state of the radio.
除非有充分的理由,否则不要覆盖本机行为。添加您自己的控件并保留后退按钮以执行其功能。请记住,当用户界面突然做出意想不到的事情时,这是多么令人沮丧。
Don't override the native behavior unless there's a really good reason to. Add your own controls and leave the back button to do what it does. Keep in mind how frustrating it is when the ui suddenly does something unexpected.