当前位置: 代码迷 >> Android >> Android 动态设立全屏,退出全屏
  详细解决方案

Android 动态设立全屏,退出全屏

热度:103   发布时间:2016-05-01 20:06:58.0
Android 动态设置全屏,退出全屏
实现全屏函数:

private void setFullScreen(){
     getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
}

退出全屏函数:

private void quitFullScreen(){
      final WindowManager.LayoutParams attrs = getWindow().getAttributes();
      attrs.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
      getWindow().setAttributes(attrs);
      getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
  }
  相关解决方案