Android 返回键监听

@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
        finish();
        overridePendingTransition(R.anim.no_animation, R.anim.push_bottom_out);
        //不执行父类点击事件
        return true;
    }
    //继续执行父类其他点击事件  
    return super.onKeyUp(keyCode, event);
}

你可能感兴趣的:(问题一览)