I have a TabActivity and want to catch and handle presses of HOME and BACK. Where do I need to catch these events?
In my subclass of TabActivity I implement the following:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
// Code handling
}
return super.onKeyDown(keyCode, event);
}
Didn't work.
So I placed a breakpoint on the switch statement line. But this function never gets called, whether I press volume up/down, menu, home, or back. Where do I need to catch these KeyEvents?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…