This method will work on any view, not just the Button view since it exists on the View base class.
All you have to do is call the View.performClick() method and it'll trigger whatever OnClickListener you've set in View.setOnClickListener().
Mainly notes to future-Twig (and for anyone else who may find them useful)
If you've found one or more of my blog posts helpful, why not say thanks by buying me a coffee or beer?
This method will work on any view, not just the Button view since it exists on the View base class.
All you have to do is call the View.performClick() method and it'll trigger whatever OnClickListener you've set in View.setOnClickListener().