I want to hide status bar in my status bar and this is how I do it:
if (Build.VERSION.SDK_INT < 16) {
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
} else {
View decorView = activity.getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN
decorView.setSystemUiVisibility(uiOptions);
}
}
The issue is when the soft keyboard becomes visible (typing in an EditText), the status bar comes back.