How to get Activity to continue streaming video when changing orientation

Possible duplicate:
Android: save MediaPlayer while updating Activity screen orientation

The YouTube Android app has some features:

When the device’s screen is in the portrait and you watch the video and change the screen orientation to landscape, the video is displayed in full screen mode and the list of related videos disappears. It continues to play without restarting or rebooting.

Portrait:

qmvpu.jpg

Landscape:

tevPS.jpg

Problems:

  • When I create layout XML files as "layout" and "layout ground", my activity is destroyed when I switch from portrait to landscape. I have to dub the video.

  • If I set Androidmanifest.xmlto use android:configChanges="orientation", then the action will not be destroyed, but the layout will not change.

?

+5
2

(, ). , - , . : / () ref ( onCreate .)

, , ; , , - .

0

android: configChanges = "" AndroidManifest,

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
}

-;

0

All Articles