Android学习 之 完全退出程序的方法

@Override
protected void onDestroy() {
// TODO Auto-generated method stub
android.os.Process.killProcess(android.os.Process.myPid());
super.onDestroy();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if (keyCode == KeyEvent.KEYCODE_BACK) {
finish();
return true;
}
return super.onKeyDown(keyCode, event);
}

你可能感兴趣的:(android)