For onTouch listener, the function is
public boolean onTouch( View v, MotionEvent event )
based on the tutorial I’m following, it stated that return true – we have already processed the event ; return false – View itself will process the event
I can’t really understand this.
This is used when there are Views on top of other Views. Imagine there are a stack of Views as follows:
So the user would see View A and then View B would be under it. If View A has an onTouch listener, it will get invoked whenever a touch occurs on that View. If false is returned, then the touch event will be passed to View B and View B’s onTouch listener (if it has one), can then go and handle the touch event.
Does that make sense?