× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Returning true and false in OnTouch?

Xaver Kapeller
Mar 13, 2015
<p>The return value determines if you consumed the touch event. </p> <p>In other words <code>true</code> means that this touch event is interesting to you and all follow up calls of this touch event like <code>ACTION_MOVE</code> or <code>ACTION_UP</code> will be delivered to you. </p> <p>If you return <code>false</code> than the touch event will be passed to the next <code>View</code> further up in the view hierarchy and you will receive no follow up calls. The touch event will continue to be passed further up the view hierarchy until someone consumes it.</p> <p>If you have any further questions please feel free to ask!</p> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/24287292/Returning%20true%20and%20false%20in%20OnTouch?/24287377">Stack Overflow</a>.</p>

Get New Tutorials Delivered to Your Inbox

New tutorials will be sent to your Inbox once a week.

comments powered by Disqus