Orignal Question
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onValueChange="@{handler.passwordValidator}"
android:text="@={model.password}"/>
I could not find parameters of android:onValueChange
. What should I put in below method parameters?
public void passwordValidator() {
}
I tried to pass empty method to this attribute, thought that logs will tell me its arguments, but I could not get that.
I could not find it in EditText Documentation.
Google search results does not contain any information about this.
Tried many possible parameters cases
android:onValueChange="@{handler.passwordValidator}"
android:onValueChange="@{handler::passwordValidator}"
android:onValueChange="@{()->handler.passwordValidator()}"
android:onValueChange="@{(v)->handler.passwordValidator()}"
android:onValueChange="@{(view, value) ->handler.passwordValidator()}"
Also please tell a way to find parameters of any attribute, so that I can find myself.
Please note, It is not related to android:onTextChanged
.
Update 1
@Tenten I got this in suggestions.
Update 2 (I thinnk, It is not IDE bug)
It can not be bug of Android because when you put unknown attribute then error comes after compilation.
Case 1 (unknown attribute)
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:asdf=""
android:text="@={model.password}"/>
AGPBI: {"kind":"error","text":"error: attribute \u0027android:asdf\u0027 not found.","sources":[{"file":"E:\AndroidWorkspace\RawSamples\Sample\app\src\main\res\layout\activity_main.xml","position":{"startLine":23}}],"original":"","tool":"AAPT"}
Case 2 (using android:onValueChange
)
Error is changed in this case, if there is no android:onValueChange
attribute then error should be same.
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onValueChange="@{handler::passwordValidator}"
android:text="@={model.password}"/>
- What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.
android.databinding.tool.util.LoggedErrorException: Found data binding errors. ****/ data binding error ****msg:Could not resolve handler::passwordValidator as a listener.
file:E:\AndroidWorkspace\RawSamples\Sample\app\src\main\res\layout\activity_main.xml loc:23:37 - 23:62 ****\ data binding error ****