<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/cow_no_of_child_edittext"
android:inputType="number"
android:text="@={String.valueOf(cow.noOfChild)}" <- This atribute
android:hint="@string/no_of_child"
android:textSize="@dimen/text_size_22sp"/>
Hi, I am facing problem while working in data binding in android. EditText is taking string value successfully. But It is not working for Integer value. In Android Monitor Log I am getting these exception messages:
Error:(165, 34) The expression java.lang.String.valueOf(cowNoOfChild) cannot cannot be inverted: There is no inverse for method valueOf, you must add an @InverseMethod annotation to the method to indicate which method should be used when using it in two-way binding expressions Error:(165, 34) The expression java.lang.String.valueOf(cowNoOfChild) cannot cannot be inverted: There is no inverse for method valueOf, you must add an @InverseMethod annotation to the method to indicate which method should be used when using it in two-way binding expressions Error:(165, 34) The expression java.lang.String.valueOf(cowNoOfChild) cannot cannot be inverted: There is no inverse for method valueOf, you must add an @InverseMethod annotation to the method to indicate which method should be used when using it in two-way binding expressions
Please provide me solution.