Skip to content Skip to sidebar Skip to footer

Why Does Using The Binding Interface Resut In A Classnotfound Exception?

I am trying to create a custom attribute for any Android View. I saw in this post that I could do it with the Data Binding Library. The Data Binding Guide and the post explain th

Solution 1:

You need to include <data> inside your <layout>:

<layoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/tools"><data></data><LinearLayoutandroid:orientation="vertical"android:layout_width="match_parent"android:layout_height="wrap_content"><TextViewandroid:id="@android:id/text1"android:layout_width="match_parent"android:layout_height="wrap_content"app:attribute="name"/></LinearLayout></layout>

On a side note, classpath 'com.android.databinding:dataBinder:1.0-rc4' and apply plugin: 'com.android.databinding' are no more needed if you are using gradle version 2.+.

Post a Comment for "Why Does Using The Binding Interface Resut In A Classnotfound Exception?"