When you have a lot of buttons, you do not bother to write code, although by rewriting the onclick more convenient, then we can not even this switch is omitted?
The answer is yes, the following plugin will help us solve the problem!
The Android-butterknife-zelezny is a plug-in customized to the Butterknife, which facilitates fast initialization
In short, when you have multiple buttons in your layout, this plugin can quickly create a good onclick code for you.
1, first, the address of the plugin Https://github.com/dongjunkun/butterknife-plugin/blob/master/butterknife-plugin.jar
2, then open as, File->setting->plugins->install from disk (the third on OK), and then restart OK
3, adding dependent libraries
Right-click app to select Open Module Setting (second last)
Dot that plus and then choose the last one!
4, so that we can use this plugin, note, when the cursor must be placed in the layout file!!!! For example:
Click the first option, then select the desired, confirm is OK, the effect is as follows:
Recommend a plugin that is used by Android studio Android-butterknife-zelezny