public void setStatus(boolean status) { boolean isStatus = status; if (isStatus){ //判断当前设备的版本号》=19的时候,走这个代码块,这个用于版本适配 if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.KITKAT){ getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); } } } public void setShowActionBar(boolean showActionBar) { boolean isShowActionBar = showActionBar; if (isShowActionBar){ getSupportActionBar().show(); }else{ getSupportActionBar().hide(); } } public void setFullScreen(boolean fullScreen) { boolean isFullScreen = fullScreen; if (isFullScreen){//是全屏的时候 getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); } }