如何监听音量按键


        public boolean onKeyDown(int keyCode, KeyEvent event) {

if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {

xxxx

}

if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {

xxxx

}

return super.onKeyDown(keyCode, event);
}

你可能感兴趣的:(监听)