How to call a click on a button Programatically?

By | March 10, 2018

The click on a button or View is usually called when the user clicks on it. But how can we call it programatically. Here is a simple example

Button btnClick = findViewById(;
LinearLayout mLayout = findViewById(;
// perform click on button
// perform click on Linear Layout

yes “performClick()”, this is how to call click programatically.

Leave a Reply

Your email address will not be published.