Android点击事件分发机制

            Activity onClick
                   +
                   |
                   +
                Window
                   |
                   |
                   +
      ViewGroup.dispatchTouchEvent
                   +
                   |
                   +
              onInterceptTouchEvent
               +                  +
               |                  |                        
               |                  |
               |                  |
               |                  |
            true                  |
               |                  |
               +               false
        onTouchEvent              |
                 		          |
                 	              |
                                  +                     		   
                 view.dispatchTouchEvent
                          +
                          |
                          +
        OnTouchListener==null
         +               +
         |               |
         |               |
      flase              |
         |               |
         |               |
         |               |
         +               |
OnTouchListener        true
        +                |
        +                |
      onTouch            |
      +      +           |
      |      +           |
  true|    false         |
      |      +           +
      +      +---+onTouchEvent
                    +
                    |
                    +
        OnClickListener==null
          +         +
          |         |
          true      flase
          |         |
          +         +
                 OnClickListener
                   onClick
                   
                   http://asciiflow.com/

你可能感兴趣的:(Android)