Why do we have to add 'View' as parameter in onClick method and what it does?
问题 I'm setting up a Event Listener on a Button in Android Studio for changing the text inside the TextView and came to this point were we define OnClick method. In its parameter list it ask for View Object. Can anyone explain what it does? I can't understand where the object of View class is going to get used. 回答1: It is there to let you reuse event handlers like the OnClick method, the View parameter is in your case the Button instance that has fired the method - multiple Buttons can have the