Specify addTextChangedListener in XML

android

Solution

Android's Data Binding Library now supports generating xml attributes for setters that exist in the view's class.

If you have data binding enabled, all you need to do is use the `app` namespace (don't forget to declare the namespace), so something like `app:addTextChangedListener="@{someobject.textwatcherfield}"`

Problem

Is there any property for EditText I can specify TextChangedListener? I know it has 3 methods, so I want just specify value of property like below ``` <EditText android:afterTextChanged="myAfterHandler" ``` However I am getting compilation errors. I can add on click listener in same way so I am wondering what is wrong on text changed? I know I can obtain view at certain time in Java code and call add listener, but this solution looks really ugly.

Original source