In my java application i have this code
@Override
public void onAttachedToWindow()
{
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DI
@Override
public void onAttachedToWindow()
{
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
super.onAttachedToWindow();
}
is used to disable home button in android but
this security flaw has been fixed in newer versions of Android so it will not work in ICS and jelly bean...!!
@Override
public void onWindowFocusChanged(boolean hasFocus) {
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
super.onWindowFocusChanged(hasFocus);
}
I had some problems with windowAttached as well, try using windowFocusChanged instead.
I've solved this issue putting
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
in onCreate before calling super.
protected void onCreate(Bundle savedInstanceState) {
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
super.onCreate(savedInstanceState);
}
Saludos desde Medellín