Can You Intercept The Long Press On Menu?
I'm using what should be pretty simple code, but it just doesn't want to work. Does the OS block intercepting this? @Override public boolean onKeyLongPress(int keyCode, KeyEvent ev
Solution 1:
You must call startTracking()
on the event from the normal onKeyPress()
method:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_MENU) {
event.startTracking();
returntrue;
}
return super.onKeyDown(keyCode, event);
}
Post a Comment for "Can You Intercept The Long Press On Menu?"