java.lang.IllegalArgumentException: Wrong number of arguments; expected 0, got 1

10-19 09:35:09.604 6356-6356/com.moreunion.zhenghao E/AndroidRuntime: FATAL EXCEPTION: main
                                                                      Process: com.moreunion.zhenghao, PID: 6356
                                                                      java.lang.RuntimeException: invoke method error:com.moreunion.zhenghao.ui.doctorclass.DoctorClassDetailsActivity#click
                                                                          at org.xutils.view.EventListenerManager$DynamicHandler.invoke(EventListenerManager.java:181)
                                                                          at java.lang.reflect.Proxy.invoke(Proxy.java:813)
                                                                          at $Proxy18.onClick(Unknown Source)
                                                                          at android.view.View.performClick(View.java:5646)
                                                                          at android.view.View$PerformClick.run(View.java:22450)
                                                                          at android.os.Handler.handleCallback(Handler.java:755)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                          at android.os.Looper.loop(Looper.java:156)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:6524)
                                                                          at java.lang.reflect.Method.invoke(Native Method)
                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
                                                                       Caused by: java.lang.IllegalArgumentException: Wrong number of arguments; expected 0, got 1
                                                                          at java.lang.reflect.Method.invoke(Native Method)
                                                                          at org.xutils.view.EventListenerManager$DynamicHandler.invoke(EventListenerManager.java:178)
                                                                          at java.lang.reflect.Proxy.invoke(Proxy.java:813) 
                                                                          at $Proxy18.onClick(Unknown Source) 
                                                                          at android.view.View.performClick(View.java:5646) 
                                                                          at android.view.View$PerformClick.run(View.java:22450) 
                                                                          at android.os.Handler.handleCallback(Handler.java:755) 
                                                                          at android.os.Handler.dispatchMessage(Handler.java:95) 
                                                                          at android.os.Looper.loop(Looper.java:156) 
                                                                          at android.app.ActivityThread.main(ActivityThread.java:6524) 
                                                                          at java.lang.reflect.Method.invoke(Native Method) 
                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941) 
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831) 


注解写法错误导致的

错误写法

    @Event( {R.id.texture_view})
    private void click() {
    }

正确写法

    @Event(value = {R.id.texture_view})
    private void click(View v) {
    }


你可能感兴趣的:(Android)