Is it mandatory to create inner classes to handle events in DataBinding?

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 …