Search code examples
androidandroid-actionbarstatusbar

Hide Status Bar but display action bar


Status bar is where battery,time is displayed and action bar is title bar.I want to hide status bar in my app but display action bar.Is it possible?


Solution

  • Write the following in Activity after onCreate:

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

    Here is screenshot:

    enter image description here