android全屏显示

无title bar

requestWindowFeature(Window.FEATURE_NO_TITLE);   

必须放在setContentView(R.layout.main); 前面,否则会报错。

全屏

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,  WindowManager.LayoutParams.FLAG_FULLSCREEN); 

 

效果为启动后状态条有个消失的动画,然后全屏

 

FLAG_FULLSCREEN

Hide all screen decorations (e.g. status bar) while this window is displayed. This allows the window to use the entire display space for itself -- the status bar will be hidden when an app window with this flag set is on the top layer.

Constant Value: 1024 (0x00000400)

你可能感兴趣的:(android)