- public void toggleFullscreen(boolean fullScreen)
- {
- //fullScreen为true时全屏,否则相反
- WindowManager.LayoutParams attrs = getWindow().getAttributes();
- if (fullScreen)
- {
- attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
- }
- else
- {
- attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
- }
- getWindow().setAttributes(attrs);
- }
来源: http://www.phpxs.com/code/1002079/