Android按返回键退出程序但不销毁代码
发布时间:2015-06-05 来源:查字典编辑
摘要:@OverridepublicbooleanonKeyDown(intkeyCode,KeyEventevent){if(keyCode==...
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { moveTaskToBack(false); return true; } return super.onKeyDown(keyCode, event); }