SetText. Note that the activity serves as its own listener for checkbox state changes since it implements the interface (via )
Note that the activity serves as its own listener for checkbox state changes since it implements the interface (via ). The callback for the listener is , which receives the checkbox whose state has changed and what the new state is. In this case, we update the text of the checkbox to reflect what the actual box contains.
The result? Clicking the checkbox immediately updates its text, as you can see in Figures 6‑4 and 6‑5.
Figure 6‑4. The CheckBoxDemo sample application, with the checkbox unchecked
Figure 6‑5. The same application, now with the checkbox checked
Дата добавления: 2015-05-16; просмотров: 814;