How to hide status bar in android in just one activity

Kunal Dudka picture Kunal Dudka · Mar 23, 2017 · Viewed 42.2k times · Source

I want to hide status bar / notification bar in splash screen I am using style:<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> this dose not hide the status bar, how should i do this?

Answer

Kiran Benny Joseph picture Kiran Benny Joseph · Mar 23, 2017

If you want to remove status bar then use this before setContentView(layout) in onCreateView method

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

credits