0
如何覆蓋紅外遙控器的電源鍵以查找已安裝Android的設備?我曾嘗試以下方式安卓紅外遠程覆蓋電源鍵
case KeyEvent.KEYCODE_STB_POWER:
Toast.makeText(this, "KEYCODE_STB_POWER key pressed",
Toast.LENGTH_SHORT).show();
return true;
case KeyEvent.KEYCODE_AVR_POWER:
Toast.makeText(this, "KEYCODE_AVR_POWER key pressed",
Toast.LENGTH_SHORT).show();
return true;
case KeyEvent.KEYCODE_TV_POWER:
Toast.makeText(this, "KEYCODE_AVR_POWER key pressed",
Toast.LENGTH_SHORT).show();
return true;
case KeyEvent.KEYCODE_POWER:
Toast.makeText(this, "KEYCODE_POWER key pressed",
Toast.LENGTH_SHORT).show();
return true;
但是以上都無效。我錯過了什麼?