I was learning about DataBinding, particularly the section about handling events and click events. Now, I noticed in a few YouTube tutorials that I instructors were mainly using an inner class to handle these events. However, earlier, I’d written this code that implemented the View.OnClickListener and directly allowed me to handle click events. Here it is: And this works. I
Tag: android-databinding
How to link a click handler to a fragment for data binding?
I want to use data binding in a fragment to trigger all my button clicks in handler class. When I run the code below I get the following error. I’m not sure if the problem is with how I’m passing the context to the Handler class or if I’ve done some wrong the Data binding. UserFragment MyClickHandlers fragment_user Answer Your
How to set visibility for include layout in databinding?
I have implemented data binding in my project. I have a particular screen with two nested layouts in include tags. I couldn’t change the visibility for include layouts using data binding programmatically. However, I have achieved it through a boolean, but my question is how to set visibility for that include tag programmatically. My xml: And in Activity: when I