How to hide status bar?

user5495265 picture user5495265 · Nov 14, 2015 · Viewed 24.5k times · Source

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 to go to the activity: How to hide status bar in Android

Thanks.

Answer

Zubair Akber picture Zubair Akber · Nov 14, 2015

Try this in you activity before setting your content

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