DataBinding first Knowledge

Source: Internet
Author: User

DataBinding is Google's latest technology

    1. For the binding of events, take the onclick of the button as an example:

      1) Define the Click event Model:

<layout xmlns:android= "" xmlns:tools= " Tools > <data> <variable name= "result" type= "" /> <variable name= "handler" type= ""/> < /data>

Loginhandler is the event model for the login button

650) this.width=650; "src=" Http:// "title=" Qq20160420163643.png "alt=" Wkiom1cxqnir-yc1aaisniehryu103.png "/>

2) binding view and model in activity

650) this.width=650; "src=" Http:// "title=" Qq20160420164504.png "alt=" Wkiom1cxqx_w4igiaacqsami_xa183.png "/>

In fact, the above callback can fully use the network request client callback, do not need to customize, a bit redundant.

This article is from the "line of the World" blog, please be sure to keep this source

DataBinding first Knowledge

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: 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.