Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用媒体播放器从 http 链接播放音频,并释放 mediaPlayer 在其中播放歌曲的活动的 mediaPlayer onStop()。我希望歌曲继续播放,除非用户退出应用程序,即退出主页。如何从主页停止和释放媒体播放器?
您将需要一个Service播放音乐的应用程序,然后您的应用程序只会向该服务发送消息。
Service