Home > Mobile >  Android XML binding file button click event
Android XML binding file button click event

Time:11-30

As title, the android binding XML file button click event, defined in the activity corresponds to the name of the method, must take the view parameters, such as myOnClick (view view), if you remove the view parameter, will flash back, no matter whether this view is used in the code, what reason is this?

CodePudding user response:

CodePudding user response:

You may have a look logcat flash back the given error knew why to want to take the view

CodePudding user response:

The View represents the View, as you can see the controls belong to View, you increase the click event must let the compiler know which View increase the click event, are you like, you want to go to the bank for business, have to have a card first,

CodePudding user response:

beginners reference 3 floor - Study reply:
View on behalf of the views, just as you can see the control belong to View, you increase the click event to which the View lets the compiler know that you are increase the click event, like, do you want to go to a bank to deal with business, have to have a card first,

Explain a bit mean, thank you

CodePudding user response:

Using reflection, requirement is must take the view parameter,
Click the view here is that,

CodePudding user response:

B: yes, so want to see more of the source code
  • Related