按后退键返回到指定界面
//按后退键返回键回主菜单
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
startActivity(new Intent(getApplicationContext(),MainActivity.class));
return true;
}
return false;
}
//按后退键返回键回主菜单
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
startActivity(new Intent(getApplicationContext(),MainActivity.class));
return true;
}
return false;
}