I would like to intercept and cancel(in some circumstances) the Home Button and Stack Button press on Android 4.1 API Level 16.
Actual limitations: - I can't change OS version, it must absolutely be Android 4.1. - Buttons are virtual, not physical - Can't be rooted
I found an exemple on the web but i can intercept all buttons except home and stack.
I tried to convert this code to MonoDroid, but i can't find the TYPE_GUARD parameter.
public override void OnAttachedToWindow()
{
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}
I also override the OnKeyDown and DispatchKeyEvent, and again i can catch all button press except home and stack.
Thanks in advance!