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:
Landscape:
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.
Androidmanifest.xml
android:configChanges="orientation"
?
(, ). , - , . : / () ref ( onCreate .)
, , ; , , - .
android: configChanges = "" AndroidManifest,
@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); }
-;