Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

the activity restarts when the phones View Mode is changed

Tags:

android

In my application while playing a video if i change the phone's mode the video does not continue to play but it starts from the beginning. all i understand is the activity is recreated when the mode is changed,how do i fix this i have no idea please someone help me fix this. thanks in advance

like image 616
cavallo Avatar asked Dec 06 '25 10:12

cavallo


1 Answers

You can add this line in your AndroidManifest file to your activity tag, by this your activity won't get re-started.

<activity android:name=".Activity_name"
          android:configChanges="orientation|keyboardHidden">
like image 149
Lalit Poptani Avatar answered Dec 07 '25 23:12

Lalit Poptani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!