manas-chaudhari / android-mvvm

MVVM on Android using RxJava and Data Binding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OnClick with rx.Action0 not working

mishkaowner opened this issue · comments

Currently using the latest configuration.
compileSdkVersion 24
buildToolsVersion "24.0.2"
and with gradle com.android.tools.build:gradle:2.2.0

public final Action0 onClickRx = new Action0() {
@OverRide
public void call() {
System.out.println("Hello world");
}
};

this just simply prints

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
java.lang.RuntimeException: Found data binding errors.
***/ data binding error ***msg:Cannot find the setter for attribute 'android:onClick' with parameter type rx.functions.Action0 on android.widget.Button.
file:D:\Users\jh\AndroidStudioProjects\MVVMTEst\app\src\main\res\layout\activity_main.xml
loc:25:31 - 25:47
***
\ data binding error ***

Ah I realized Using bindAdapter fixes this. sorry for inconvenience