@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
Intent mIntent = new Intent(Intent.ACTION_MAIN);
mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
mIntent.addCategory(Intent.CATEGORY_HOME);
startActivity(mIntent);
return true;
}
return super.onKeyDown(keyCode, event);
}
Android点击返回键跳转到系统桌面
最新推荐文章于 2024-09-12 00:58:02 发布