34,333
edits
Changes
→Adding the Layout Element
== Adding Adding the Layout Element ==
As described in “An Overview of Android Jetpack Data Binding”, in order to be able to use data binding, the layout hierarchy must have a layout component as the root view. This requires that the following changes be made to the main_fragment.xml layout file (app -> res -> layout -> main_fragment.xml). Open this file in the layout editor tool, switch to Text mode and make these changes:
<android.support.constraint.ConstraintLayout
android:id="@+id/main"
android:layout_width="match_parent"