1 public void toggleFullscreen(boolean fullScreen)  
 2  {  
 3   //fullScreen为true时全屏 
 4     
 5      WindowManager.LayoutParams attrs = getWindow().getAttributes();  
 6        
 7      if (fullScreen)  
 8      {  
 9          attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;  
10      }  
11      else  
12      {  
13          attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;  
14      }  
15        
16      getWindow().setAttributes(attrs);  
17  }  

 

posted on 2015-11-25 22:00  0代码狂人0  阅读(322)  评论(0编辑  收藏  举报