public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_VOLUME_DOWN ) { if(event.getAction() == KeyEvent.ACTION_DOWN) {//测试发现只有ACTION_DOWN这个事件//do something } } return super.onKeyDown(keyCode, event);}<pre name="code" class="java">@Override
Android app 中响应hardkey press event
最新推荐文章于 2021-05-30 11:25:15 发布