android 中让activity全屏幕显示

android 中让activity全屏幕显示,这是一个小tips,两个方法实现:
1)


public class FullScreen extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                                WindowManager.LayoutParams.FLAG_FULLSCREEN);

        setContentView(R.layout.main);
    }
}





2 也可以属性设置的方法:
  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

你可能感兴趣的:(Android)