In the XML
of my MainActivity
, I have programmed it so that it uses a theme with NoActionBar
and therefore there is no ac
I found a resource from the android official docs. So basically, for android version 4.1 and higher, use this code:
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
// Remember that you should never show the action bar if the
// status bar is hidden, so hide that too if necessary.
ActionBar actionBar = getActionBar();
actionBar.hide();
PS: Source Link to official android doc