Possible Duplicate:
Android: Keep MediaPlayer running during Activity screen orientation update
Android's YouTube app has some features:
When the screen of the device is in portrait and you watch a video and change the orientation of the screen to landscape, the video is shown full screen and the list of related videos disappears. It continues playing without restarting or restreaming.
Portrait:
Landscape:
The problems are:
When I create my layout XML files as "layout" and "layout-land", my Activity is destroyed when going from portrait to landscape. I have to restream the video.
If I set
Androidmanifest.xml
to useandroid:configChanges="orientation"
, then the Activity is not destroyed, but the layout does not change.
How can I achieve this?