July 03, 2000
dataBindinbg { enabled = true }
를 추가해야 합니다.<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="text"
type="com.afsdf.asdf.TextSample"/>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView_sample"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{text}"/>
</LinearLayout>
</layout>
DataBindingUtil.setContentView(this, R.layout.activity_main)