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. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.