I hid my notification bar for my activity by changing the theme to
Theme.NoTitlebar.FullScreen and then changed it in my manifest too.
I successfully hid the notification bar. But if I lock and then again unlock the screen when in the same activity, the notification bar becomes visible. How do I overcome this?
I want to hide my notification bar throughout my activity.
I have same problem when I use TabHost. Here are a workaround for this problem:
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
getWindow().getDecorView().postDelayed(new Runnable() {
@Override
public void run() {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}, 100);
}
}
This is drawn first with the notification bar and redrawn after the ms.
The best solution, if you don't use TabHost.