Android 设置Activity 全屏的方法

1、代码实现

public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		//==============注意要在加载setContentView(R.layout.main)之前设置,不然程序崩溃===============
		 //无title     
          requestWindowFeature(Window.FEATURE_NO_TITLE);   
		//全屏
		getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN ,                
          WindowManager.LayoutParams. FLAG_FULLSCREEN);  
		//==============注意要在加载setContentView(R.layout.main)之前设置,不然程序崩溃===============
		setContentView(R.layout.main);
	}


2、在AndroidManifest.xml的Activity 属性中设置

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"


        






你可能感兴趣的:(相关,Android)