0

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

indira
  • 6,569
  • 18
  • 65
  • 80

3 Answers3

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
0

you did not mention are you using fragments. this code may help you

 android:configChanges="orientation|keyboardHidden|screenSize"

and also see this link

orientation change

Community
  • 1
  • 1
Invader
  • 679
  • 3
  • 10