[英]how to disable status or notification bar for android activities
I have referred many solutions but using that my app crashes 我已经介绍了许多解决方案,但使用它时我的应用程序崩溃了
I am using custom theme as I am using custom action bar 我使用自定义主题就像使用自定义操作栏
this is the code which I am using the style 这是我正在使用样式的代码
<style name="MyCustomTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/MyActionBarTheme</item>
</style>
Also using below code crashes my app 还使用下面的代码使我的应用程序崩溃
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
You should use this before setContentView
您应该在setContentView
之前使用它
if (Build.VERSION.SDK_INT < 16) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
else
{
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.