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(R.id.btnClick); LinearLayout mLayout = findViewById(R.id.mLayout); // perform click on button btnClick.performClick(); // perform click on Linear Layout mLayout.performClick();
yes “performClick()”, this is how to call click programatically.