From the course: Android Development: Data Binding

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create binding layout

Create binding layout - Android Tutorial

From the course: Android Development: Data Binding

Start my 1-month free trial

Create binding layout

- [Instructor] So now that our project is set up to use data binding, let's take our original weather data layout and convert it to bind to data within our app. So, I'm going to open up the layout file for these simple example activity, which is pretty much a duplicate of our existing main activity with all the same text fields and so on, all right. And what I'm going to do, is if we go to the design view, okay, you can see that we have our text fields and then the temporary values where the data is going to go. (mouse clicks) And then I'm going to open up the SimpleExample activity code, and again, this is pretty much a duplicate of our existing activity. Now, Android Studio provides an automatic converter to take a regular layout and convert it to a data binding layout. So, we're not going to do that here, what we're going to do is convert it manually, but I wanted to show you how this works. If you right-click…

Contents