1.横屏时图像不再播放,折腾后发现配置文件加一句 android:configChanges="keyboardHidden|orientation|screenSize"搞定。
2.动态改变是否全屏则加以下代码:
public void fullScreenChange(boolean fullScreen) {
Window window = context.getWindow();
WindowManager.LayoutParams attrs = window.getAttributes();
if (!fullScreen) {
attrs.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
window.setAttributes(attrs);
window.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
} else {
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
window.setAttributes(attrs);
window.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
}