导入两个包:
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); } }
Android应用程序全屏显示方法,布布扣,bubuko.com
原文地址:http://blog.csdn.net/cnshsh/article/details/25619579