首页 > 代码库 > Android应用程序全屏显示方法

Android应用程序全屏显示方法

导入两个包:

import android.view.Window;
import android.view.WindowManager;

public class MainActivity extends ActionBarActivity 
{
	@Override
    protected void onCreate(Bundle savedInstanceState) 
	{
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);	//设置程序不显示标题
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                WindowManager.LayoutParams.FLAG_FULLSCREEN);	//设置不显示状态栏
        setContentView(R.layout.activity_main);

    }

}