安卓开发-标题栏和状态栏的去除

        //去掉顶部标题
        getSupportActionBar().hide();
        //去掉最上面时间、电量等
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

将以上代码插入到   setContentView(R.layout.activity_main);    的上面。(原因是:这行代码的意义是开始构建主页面,当然要在主页面之前告诉系统说我要怎么样)。

原文地址:https://www.cnblogs.com/KeithTee/p/14692684.html