- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- int v = this.getWindow().getAttributes().flags;
- // 全屏 66816 - 非全屏 65792
- if(v != 66816){//非全屏
- this.getWindow().setFlags(
- WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
- }else{//取消全屏
- this.getWindow().clearFlags(
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
- }
- }
时间: 2024-11-06 17:47:01