I have an activity which extends an AlertActivity. In that I am trying to play an audio file. When orientation changes audio goes stop. I want to continue playing audio even if the orientation changes. How can I prevent calling onPause and onStop when orientation changes? Please help
Asked
Active
Viewed 145 times
3 Answers
1
Go to manifest and add this to your activity android:configChanges="orientation|screenSize|keyboardHidden"

kamal vaid
- 862
- 7
- 12
0
Try this Code : Add in Manifest File
<activity android:name=".Activity_name"
android:configChanges="orientation|keyboardHidden|screenSize"

KOTIOS
- 11,177
- 3
- 39
- 66
-
Add it to the AndroidManifest.xml file – Santosh Kathait Nov 15 '13 at 05:12
0
you did not mention are you using fragments. this code may help you
android:configChanges="orientation|keyboardHidden|screenSize"
and also see this link