Search code examples
androidandroid-actionbarfullscreen

ActionBar appears when i press on Edittext and when i finish typing and close the keyboard it is still there


Is there anyway to permanently remove this actionbar? I tried these two ways but they didn't work:

this ..

    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>

and this ...

    getWindow().getDecorView().setSystemUiVisibility(
              View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_FULLSCREEN
            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);

First activity: enter image description here

When i click on EditText: enter image description here

When i close the keyboard:


Solution

  • That is not the ActionBar it is called the Status bar in android. Because it persists the status of some important utilities like your network and battery status.

    Coming to your question.

    FOR Android 4.0 and Lower

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
    

    FOR Android 4.1 and Higher

    View decorView = getWindow().getDecorView();
    
    int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
    decorView.setSystemUiVisibility(uiOptions);
    //if you have action bar present make sure to hide it
    ActionBar actionBar = getActionBar();
    actionBar.hide();