4 Ways To Implement OnClickListener On Android
Cody Engel

Or you can also create a public method that you reference in your XML layout file, like:

<Button android:onClick=”myAwesomeClickMethod” />

Or better yet, you could use DataBinding to add OnClickListeners to your views which makes things even less coupled (i.e. put the click listeners in your ViewModels that you of course already have ;-)).

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.