Android mobile guard-event transfer & amp; response rules, android guard-Transfer

Source: Internet
Author: User

Android mobile guard-event transfer & response rules, android guard-Transfer

Question:

This article address: http://www.cnblogs.com/wuyudong/p/5911187.html, reproduced please indicate the source address.

In the previous article, the TextView text is changed when you click the SettingItemView entry, but when you select the checkbox in the custom control SettingItemView, The TextView text is not changed.

Here you need to understand the event Transfer Process

SettingActivity corresponds to the click event for obtaining the layout of the layout file. This event is passed to SettingItemView.

1. Click in the SettingItemView non-CheckBox area, and the event will be responded by SettingItemView
2. Click the CheckBox area in SettingItemView. The event is passed to the CheckBox by SettingItemView, And the CheckBox responds.

When the CheckBox responds to the current Click Event, the SettingItemView will no longer be able to respond to this event, and The onClick method cannot be called to change the status.

The solution to this problem is to prevent the checkBox from responding to the click event.

<! -- Android: clickable = "false" android: focusable = "false" android: focusableInTouchMode = "false" prevents the current CheckBox from being clicked, that is, it cannot respond to events --> <CheckBox android: id = "@ + id/cb_box" android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: layout_alignParentRight = "true" android: layout_centerVertical = "true" android: clickable = "false" android: focusable = "false" android: focusableInTouchMode = "false"/>

 

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.