© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Stephen Florentino
Full StackOverflow Developer
I don't think there is a technical reason for doing this. I bet the author just wanted to illustrate a point while avoiding getting bogged down with the details, e.g. not having to create another class that extends View.OnclickListener.