更新时间:2023-02-24 23:25:12
您好再次 您可以覆盖home键任何其他按钮:
Hi again You can override the home button as any other button:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_HOME)) {
Toast.makeText(this, "You pressed the home button!", Toast.LENGTH_LONG).show();
return true;
}
return super.onKeyDown(keyCode, event);
}