1#
安卓监听点击事件

public boolean onKeyDown(int keyCode, KeyEvent event)
    {
        DisplayToast(Integer.toString(keyCode));
        switch (keyCode)
        {
            
            case KeyEvent.KEYCODE_DPAD_CENTER:
                DisplayToast("zhong");
                break;
            case KeyEvent.KEYCODE_DPAD_UP:
                DisplayToast("shang");
                break;
            case KeyEvent.KEYCODE_DPAD_DOWN:
                DisplayToast("xia");
                break;
            case KeyEvent.KEYCODE_DPAD_LEFT:
                DisplayToast("zuo");
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                DisplayToast("you");
                break;
        }
        return super.onKeyDown(keyCode, event);
    }
    /* �����������¼� */
    public boolean onKeyUp(int keyCode, KeyEvent event)
    {
        DisplayToast(Integer.toString(keyCode));
        switch (keyCode)
        {
            
            case KeyEvent.KEYCODE_DPAD_CENTER:
                DisplayToast("zhong");
                break;
            case KeyEvent.KEYCODE_DPAD_UP:
                DisplayToast("shang");
                break;
            case KeyEvent.KEYCODE_DPAD_DOWN:
                DisplayToast("xia");
                break;
            case KeyEvent.KEYCODE_DPAD_LEFT:
                DisplayToast("zuo");
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                DisplayToast("you");
                break;
        }
        
        return super.onKeyUp(keyCode, event);
    }
    
    public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event)
    {
        
        return super.onKeyMultiple(keyCode, repeatCount, event);
    }
    
    /* �����¼� */
    public boolean onTouchEvent(MotionEvent event)
    {
        int iAction = event.getAction();
        if (iAction == MotionEvent.ACTION_CANCEL ||
            iAction == MotionEvent.ACTION_DOWN ||
            iAction == MotionEvent.ACTION_MOVE)
        {
            return false;
        }

        int x = (int) event.getX();
        int y = (int) event.getY();
        
        DisplayToast("���ʵ����꣺("+Integer.toString(x)+","+Integer.toString(y)+")");
        
        return super.onTouchEvent(event);
    }