Continue Streaming on Orientation change

守給你的承諾、 提交于 2019-12-12 01:08:26

问题


I have a music streaming service in my activity. My problem is when orientation changes downloading process starts from beginning. I know activity recreated on orientation change. I want my activity to ignore changing orientation. I tried some methods like adding android:configChanges="orientation" or add onConfigurationChange(newConfig) to my activity but none of them works. Thanks in advanced.


回答1:


try this....

android:configChanges="keyboardHidden|orientation|screenSize" >



回答2:


Here you have to add in your AndroidManifest.xml file for orientation and for screenSizes

 android:configChanges="keyboardHidden|orientation|screenSize" >


来源:https://stackoverflow.com/questions/21497953/continue-streaming-on-orientation-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!