2

I am new to android so please if I sound stupid, do not reply.

Hello, I have tried searching all over the net for a good tutorial that would help me understand how android takes the touch events and reacts accordingly. But I have not been successful. If anyone knows a good tutorial that could help me, please post it here. It would be very helpful.

efa
  • 43
  • 2
  • 4
  • 9

3 Answers3

3

This tutorial is a bit long, but it takes you through start-to-finish creating a simple app that handles touch events. I liked it and hope it helps:

http://www.kellbot.com/2009/06/android-hello-circle/

TomBomb
  • 3,236
  • 5
  • 31
  • 40
2

To make it simple...

There is an hierarchy of views that Android maintains and the events are handled accordingly. Every View in the hierarchy gets the event, but only if the parent event has not consume it. Meaning - if you have a parent view that handles onTouchEvent() and returns true every time, the child never receives the event.

That should explain the main behaviour, but feel free to post some additional questions :)

LambergaR
  • 2,433
  • 4
  • 24
  • 34
2

This tut gives a quick overview on how Android handles touch events. Plus ScaleGestureDetector class is explained.Hope it helps:
http://www.vogella.de/articles/AndroidTouch/article.html

Ricardo Simmus
  • 334
  • 4
  • 19