I am trying to use the new Android data binding library and get the following error while trying to populate the counter with the selected value.
Error message (during compilation in Android Studio):
Error: execution completed for task ': app: compileDebugJavaWithJavac'. java.lang.RuntimeException: Data binding errors detected. **** / data binding error **** msg: Unable to find the installer for the attribute "app: selection" with parameter type java.lang.String. file: /Users/ove/Code/AndroidStudio/Samples/Receipts/app/src/main/res/layout/dialogfragment_inputamount_db.xml loc: 40: 29 - 40:44 **** \ data binding error ****
My layout file looks like the following (not complete):
<?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"> <data> <variable name="receipt" type="com.example.model.Receipt" /> </data> </LinearLayout> <Spinner android:layout_width="wrap_content" android:id="@+id/currency" android:layout_height="wrap_content" android:spinnerMode="dropdown" android:entries="@array/currency_array" app:selection="@{receipt.currency}" /> </LinearLayout> </layout>
Anyone able to get data binding for working with spinners?
Ov
source share