项目报以下错误:
E/AndroidRuntime( 7096): java.lang.IllegalStateException: Could not find a method false(View) in the activity class com.android.contacts.activities.xxxxActivity for onClick handler on view class android.widget.ImageView with id 'account_icon'
E/AndroidRuntime( 7096): at android.view.View$1.onClick(View.java:3592)E/AndroidRuntime( 7096): at android.view.View.performClick(View.java:4210)
E/AndroidRuntime( 7096): at android.view.View$PerformClick.run(View.java:17437)
E/AndroidRuntime( 7096): at android.os.Handler.handleCallback(Handler.java:725)
E/AndroidRuntime( 7096): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 7096): at android.os.Looper.loop(Looper.java:153)
E/AndroidRuntime( 7096): at android.app.ActivityThread.main(ActivityThread.java:5297)
E/AndroidRuntime( 7096): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7096): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 7096): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
E/AndroidRuntime( 7096): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
E/AndroidRuntime( 7096): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 7096): Caused by: java.lang.NoSuchMethodException: false [class android.view.View]
E/AndroidRuntime( 7096): at java.lang.Class.getConstructorOrMethod(Class.java:460)
E/AndroidRuntime( 7096): at java.lang.Class.getMethod(Class.java:915)
E/AndroidRuntime( 7096): at android.view.View$1.onClick(View.java:3585)
E/AndroidRuntime( 7096): ... 11 more
这原因是你在当前的xxxxActivity中给某一个View控件添加它没有方法,如我的错误是 给id为account_icon的ImageView添加一个Onclick方法,所以在点击此ImageView时报错误,有可能你并没有在当前activity中实例化此imageview,只此imageview的acitivity界面中,可在此imageview的layout布局中去看看是否给此iamgeview添加一个android:οnclick="true"属性