//activity_main.xml 添加layout根布局,添加bind域名空间
<layout xmlns:andro> xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:bind="http://schemas.android.com/apk/res-auto"> <data> <variable name="listener" type="android.view.View.OnClickListener"/> </data> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
...
<include
android:> </LinearLayout>
</layout>