Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rotating phone restarts video on android

When I rotate my phone, my Activity restarts. I have a video view playing video, I rotate and the video restarts. Now I found adding this to my activity in the manifest fixed it

<activity android:name="Vforum" android:configChanges="orientation"></activity>

The problem now is the video controls aren't being redrawn until they disappear and come back, thus leaving either really long controls going from landscape to portrait mode or really short controls going from portrait to landscape. Once they disappear and then I tap to make them come back, then they are correctly sized. Is there a better method of doing this?

like image 563
Ronnie Avatar asked May 12 '11 19:05

Ronnie


1 Answers

add

android:configChanges="orientation"

to your Activity in AndroidManifest.xml.

  • solved my issue won't download progressive video again..

If your target API level 13 or higher, you must include the screenSize value in addition to the orientation value as described here. So your tag may look like

android:configChanges="orientation|screenSize"
like image 173
Ashok Avatar answered Oct 21 '22 11:10

Ashok