When using databinding in my app, I get the following warning when compiling:
Warning:Method references using \'.\' is deprecated. Instead of \'handler.onItemClick
I didn't want to switch off Java 8 so I used the lambda expressions in databinding instead:
android:onClick="@{(v)->handler.onItemClick(v)}"
Here is an article by George Mount that gives lots of examples.
One thing to note is that the lambda expression is bound when the event occurs not at binding time.