I am trying to prevent status bar expansion and I have used some examples where people are trying to override the home button. All solutions point to using WindowMana
Update onAttachedToWindow as shown below and try
@Override
public void onAttachedToWindow() {
if (!GlobalVars.testing) {
GlobalVars.preventStatusBarExpansion(this);
}
super.onAttachedToWindow();
}
and add update oncreate with
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
...
}
For Api above 14 use
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);