I see the following compiler warning when building my project:
warning: Method references using '.' is deprecated. Instead of 'item.onCardClicked', use 'item::onCardClicked'
I am using android plugin for gradle 2.1.0.
My layout file looks like the following:
<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="item"
type="com.example.Card"/>
</data>
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="@{item.onCardClicked}"/>
...
</LinearLayout>
</layout>
Can someone point me to the right direction to resolve this warning?
Per the error message:
warning: Method references using '.' is deprecated. Instead of 'item.onCardClicked', use 'item::onCardClicked'
So replace @{item.onCardClicked}
with @{item::onCardClicked}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With