扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
本文实例讲述了Android编程实现播放视频时切换全屏并隐藏状态栏的方法。分享给大家供大家参考,具体如下:
1.
Demo示例:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { getWindow().getDecorView().setSystemUiVisibility(View.INVISIBLE); } else if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { // this.requestWindowFeature(Window.f);// 去掉标题栏 // this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, // WindowManager.LayoutParams.FLAG_FULLSCREEN);// 去掉信息栏 Log.i("info", "portrait"); // 竖屏 }
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流