How can I prevent a re-start of my app when the phone is rotated?
In my app I don't want to restart a m开发者_高级运维edia player once it starts if the user rotates the phone. How can I prevent a re-start of my app when it is rotated because it stops the running sound file that is playing?
Please show me the code I need to add and where to add it.
Thanks.
Truly, Emad
use this
<activity android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden" android:name="VncCanvasActivity">
see this
You have to redesign your application to play the music from a service instead of from your main activity. Your main activity can at any time be killed by the operating system if it decides it needs memory.
See What is a service
精彩评论