In " implement drag and drop on android", I wrote the rules how touch event can be passed to the touched view's parent, and how a parent can intercept the touched view's event. On a device without mouse, Click and LongClicked events are also strongly related to touch event. So, I'll summarize how they are related.

  1. Button widget doesn't bubble event. If a button is touched, it doesn't pass the event to its parent in any case. (There should be more widgets exhibit this character.)
  2. Touch event doesn't bubble up to parent if the widget also registers Click or LongClick event handler.
  3. If a widget registers both Touch and Click event handler, Click event fires only when Touch event handler returns false. In other words, Click event gets fired only when touch event handler declares it's not interested in the touch event.
  4. If a widget registers both Click and LongClick event handler, and LongClick event get fired. Click event will be fired only if LongClick event handler returns false.

Testing Code:
http://code.google.com/p/rxwen-blog-stuff/source/browse/trunk/android/touch_events/

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Afinal简介
  2. 本科学习Android笔记之传智播客_快速掌握
  3. 使用Jenkins自动打包android
  4. 关于实现S5PV210同时跑wince 和android双
  5. 关于Android(安卓)O不能正常推送通知问题
  6. Android短信发送流程(原)
  7. Android系统权限和root权限的获取以及应
  8. Android(安卓)4.2上调试RT3070 WiFi模块
  9. android socket 编程实例
  10. React Native 实现热部署、差异化增量热