Android Architecture Components meets Data Binding : Lifecycle awareness!
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfb9udkRUu_bfbMsWrvqxd0KGV2ONsptsAWJdIovf30ntXjP56wNFS9wKXYWp0RnszjY1KEFFIssjAj8PO6qsQBb3ZcDrg4X3zxtwGrTotON62jTb4uBPgS63pYOs1LYkdKcP_1FxEw-ZO/s640/ezgif-5-a842fa6408.gif)
Finally Android Data Binding library got updated to play nice with Android Architecture Components library and became life-cycle aware! This means that any changes to the LiveData objects will be reflected in the layouts... automagically! :) * Tested on Android Studio 3.1 - canary 6 Whats new? To make the binding life-cycle aware you need to pass the life-cycle owner to the ViewDataBinding by calling the setLifecycleOwner method. The ViewModel: Our view model consists of the LiveData object that is simply and observable data container, where the observer gets notified of data changes. The model: Our model has one field that is used to store user's name. A POJO. The layout: -Out layout consists of a text field that is bound to the user's name. And will be updated when our LiveData container posts a change. -We also have an EditText that is two-way bound to the user's name, meaning when text gets entered, the name is updated and vise-versa, when the use