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);
}
上一篇:Codeforces Global Round 18 A-C题解


下一篇:AcWing 796. 子矩阵的和