android手机返回键对应处理

/**
     * 返回键对应处理
     * @param keyCode
     * @param event
     * @return
     */
    public boolean onKeyDown(int keyCode, KeyEvent event)
    {
        if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0)
        {
//            event.startTracking();
            Log.v("--------------------------", "-------------------------------");
            Intent intent = new Intent();
            intent.setClass(ViewFlipperActivity.this, Paging.class);
            intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
            startActivity(intent);
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }

你可能感兴趣的:(Android)