问题
In my android app, I am playing a youtube video using WebView
with IFrame
. When the activity-UI is in portrait mode and I click on the youtube video at the bottom right corner to make it full screen, it appears to have have become full screen for a second. But then it switches back to original size quickly and the activity-UI goes into landscape mode.
回答1:
I found the solution on another stack-overflow question: link I had to do this: android:configChanges="orientation"
in my AndroidManifest file for that activity. The problem is when orientation changes, the activity is destroyed and setting this doesn't destroy the activity it only invokes the onConfigurationChanged(Configuration)
method.
来源:https://stackoverflow.com/questions/9960582/youtube-video-full-screen-mode-switches-activity-ui-into-landscape-mode