原因是view重写了dispatchKeyEvent,并返回了true。
解决:在view重写的dispatchKeyEvent返回true时,调用
playSoundEffect(SoundEffectConstants.getContantForFocusDirection(getDirection(event)));
private Integer getDirection(KeyEvent event) { Integer direction = null; switch (event.getKeyCode()) { case KeyEvent.KEYCODE_DPAD_LEFT: direction = FOCUS_LEFT; break; case KeyEvent.KEYCODE_DPAD_RIGHT: direction = FOCUS_RIGHT; break; case KeyEvent.KEYCODE_DPAD_UP: direction = FOCUS_UP; break; case KeyEvent.KEYCODE_DPAD_DOWN: direction = FOCUS_DOWN; break; default: break; } return direction; }