我只能把我的活动,以全屏的onCreate方法(之前的setContentView)?
I can only set my Activity to Full Screen in onCreate method (before setContentView)?
有什么办法,我可以设置为全屏的onCreate之外?
Is there any way I can set to full screen outside of onCreate?
感谢
是可能的!添加此code。
Is possible! Adding this code.
// go full screen
WindowManager.LayoutParams attrs = mActivity.getWindow().getAttributes();
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
mActivity.getWindow().setAttributes(attrs);
// go non-full screen
WindowManager.LayoutParams attrs = mActivity.getWindow().getAttributes();
attrs.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
mActivity.getWindow().setAttributes(attrs);