How can I hide the status bar for a specific activity?
I found this similar question, but none of the answers worked for me. The app just crashed every time I tried
if (Build.VERSION.SDK_INT < 16)//before Jelly Bean Versions
{
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
else // Jelly Bean and up
{
View decorView = getWindow().getDecorView();
// Hide the status bar.
int ui = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(ui);
//Hide actionbar
ActionBar actionBar = getActionBar();
actionBar.hide();
}