How to handle Button Click?
Step 0: First of all we get reference of button from layout
Step 1: Now set onClickListner in side onCreate Method
Step 2: Now we look at second method which is on click method. in our resource layout file you have to put following code for button
Step 3: now we create that mehod in our class which we want to triger when button clicked
In this tutorial we learn about how to handle actions when user clicks on a button in android. here i will discuss two methods 1: onClickListner 2: onClick method,