返回时,新意图/活动的 Android 列表视图会停止媒体播放器
我本质上拥有的是 tabview
,里面有一个 listview
。当按下 listview
中的某个项目时,会创建一个新的 intent
将它们带到不同的视图。该视图内有一个mediaplayer
。我的问题是,当我尝试返回到 tabview
时,我的 mediaplayer
停止播放,并且 view
不会保持完整。有办法解决这个问题吗?我本质上希望能够来回移动并让媒体播放器的视图保持完整。我希望这是有道理的。谢谢。
编辑: 我通过使用活动组并将媒体播放器置于服务中解决了这个问题
What I essentially have is tabview
with a listview
inside. When an item in the listview
is pressed, a new intent
is created to take them to a different view. Inside this view is a mediaplayer
. My problem is that when I try to go back to the tabview
my mediaplayer
stops playing and the view
doesn't stay intact. Is there anyway to fix this? I essentially want to be able to go back and forth and have the view with the mediaplayer stay intact. I hope this makes sense. Thanks.
EDIT:
I solved this by using an activity group and by having the media player in a service
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过使用活动组并让媒体播放器在后台运行的服务中解决了这个问题
I solved this issue by using an activity group and having the media player in a service running in the background