Search code examples
androidstatusbar

How hide and show status bar


Just it, I have found how to hide title bar but I didnt find how hide / show the status bar pressing a button fr example. It is possible? thanks!


Solution

  • To hide a status Bar

    Use this code in your Activity

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

    Change Application theme in Manifest file as below

          android:theme="@android:style/Theme.Black.NoTitleBar"