Question

In my app I don't want to restart a media 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

Was it helpful?

Solution

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

OTHER TIPS

use this

  <activity android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden" android:name="VncCanvasActivity">

see this

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top