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.
在我的应用程序中,如果用户旋转手机,我不想在媒体播放器启动后重新启动它。如何防止我的应用程序在旋转时重新启动,因为它会停止正在播放的正在运行的声音文件?
请告诉我需要添加的代码以及添加位置。
谢谢。
真的,埃马德
用这个
<activity android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden" android:name="VncCanvasActivity">
看到这个
您必须重新设计您的应用程序以从服务而不是您的主要活动中播放音乐。如果操作系统决定它需要内存,您的主要活动可以随时被操作系统杀死。
查看什么是服务