The difference between Android touch events and click events

Source: Internet
Author: User

To figure this out, just understand what Android's so-called consumption (consume) concept of event handling is, and a user's actions are passed to different view controls and different listening methods for the same control. Any method that receives and processes the event returns true after processing, and if the event is fully processed, the other view or listener method will not be able to process the event again.

The occurrence of Onlongclick is done by a separate thread, and before action_up, and the onclick occurs after action_up, so the same user touch operation may occur both Onlongclick and onclick. Isn't that incredible? So timely to the system to say "I have completely processed (consumption) of the user's this operation" is very important thing. For example, if we return true at the end of the Onlongclick () method, then the OnClick event has no chance of being triggered.

Original: http://www.open-open.com/lib/view/open1378910459772.html

The difference between Android touch events and click events

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.