I defined a new Activity on my project and I have some trouble with fullScreen.
I defined in the manifest file like this:
I fond the issue. There is a method I omitted to add in question text - I didn't thought it's relevant. Because I want this activity to intercept (do not react) home button press, and for this reason I override onAttachedToWindow() method like this:
public void onAttachedToWindow() {
getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}
And here is the issue. Some times, because of this, my activity didn't get full screen. To fix this, I don't know if this is the best way, I added a delay to this code, like this:
public void onAttachedToWindow() {
handler.sendEmptyMessageDelayed(100,100);
super.onAttachedToWindow();
}
and the handler:
public boolean handleMessage(Message msg) {
getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
}
and this solved my issue. I hope this help someone!