java.lang.NoSuchMethodException: [class android.view.View]

05-24 11:38:35.884: E/AndroidRuntime(1819): FATAL EXCEPTION: main
05-24 11:38:35.884: E/AndroidRuntime(1819): Process: com.example.activitytest, PID: 1819
05-24 11:38:35.884: E/AndroidRuntime(1819): java.lang.IllegalStateException: Could not find a method (View) in the activity class com.example.activitytest.ThirdActivity for onClick handler on view class android.widget.Button
05-24 11:38:35.884: E/AndroidRuntime(1819): at android.view.View$1.onClick(View.java:3810)
05-24 11:38:35.884: E/AndroidRuntime(1819): at android.view.View.performClick(View.java:4438)
05-24 11:38:35.884: E/AndroidRuntime(1819): at android.view.View$PerformClick.run(View.java:18422)
05-24 11:38:35.884: E/AndroidRuntime(1819): at android.os.Handler.handleCallback(Handler.java:733)
05-24 11:38:35.884: E/AndroidRuntime(1819): at android.os.Handler.dispatchMessage(Handler.java:95)
05-24 11:38:35.884: E/AndroidRuntime(1819): at android.os.Looper.loop(Looper.java:136)
05-24 11:38:35.884: E/AndroidRuntime(1819): at android.app.ActivityThread.main(ActivityThread.java:5017)
05-24 11:38:35.884: E/AndroidRuntime(1819): at java.lang.reflect.Method.invokeNative(Native Method)
05-24 11:38:35.884: E/AndroidRuntime(1819): at java.lang.reflect.Method.invoke(Method.java:515)
05-24 11:38:35.884: E/AndroidRuntime(1819): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-24 11:38:35.884: E/AndroidRuntime(1819): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-24 11:38:35.884: E/AndroidRuntime(1819): at dalvik.system.NativeStart.main(Native Method)
05-24 11:38:35.884: E/AndroidRuntime(1819): Caused by: java.lang.NoSuchMethodException: [class android.view.View]
05-24 11:38:35.884: E/AndroidRuntime(1819): at java.lang.Class.getConstructorOrMethod(Class.java:472)
05-24 11:38:35.884: E/AndroidRuntime(1819): at java.lang.Class.getMethod(Class.java:857)
05-24 11:38:35.884: E/AndroidRuntime(1819): at android.view.View$1.onClick(View.java:3803)
05-24 11:38:35.884: E/AndroidRuntime(1819): ... 11 more

button 的布局文件中 android :onclick="" 没添加方法

这原因是你在当前的xxxxActivity中给某一个View控件添加它没有方法,如我的错误是 button添加一个Onclick方法,所以在点击此ImageView时报错误,有可能你并没有在当前activity中实例化此imageview,只此imageview的acitivity界面中,可在此imageview的layout布局中去看看是否给此iamgeview添加一个android:onclick="true"属性

时间: 2024-12-26 20:59:44

java.lang.NoSuchMethodException: [class android.view.View]的相关文章

Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android

?? 在写自己定义的view时,有时会报下面错误: Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet] <view android:id="@id/viewpage_container" android:layout_width="fill_parent" and

Caused by: java.lang.NoSuchMethodException: &lt;init&gt; [class android.content.Context, interface androi

报错提示代码: Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet] 1.报错原因: 在自定义view时,没有重写含有(Context context,AttributeSet attrs)的构造器 解决办法: 重新对于构造器,例如: public ControlKeyboardLinearLayout(Con

Caused by: java.lang.NoSuchMethodException: &lt;init&gt; [class android.content.Context, interface android

 在写自定义的view时,有时会报以下错误: Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet] <view android:id="@id/viewpage_container" android:layout_width="fill_parent" andr

Caused by: java.lang.NoSuchMethodException:

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime: FATAL EXCEPTION: main 10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime: Process: com.zaizai.safty, PID: 27343 10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidR

Spring3.2 Contorller单元测试参数问题: java.lang.NoSuchMethodException

使用3.2做单元测试的时候发现这个问题,因为之前都是用3.0中的配置适配器使用AnnotationMethodHandlerAdapter,到3.2中升级为RequestMappingHandlerAdapter: 运行之前的单元测试发现报异常:java.lang.NoSuchMethodException,看了一下堆栈发现反射调用的方法签名明显不对,于是看了一下调用的代码, 之前是:handlerAdapter.handle(request, response,  new HandlerMet

MyBatis3.4.0以上的分页插件错误:Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler named prepare. Cause: java.lang.NoSuchMethodException: org.apache.ibatis.executor.stateme

错误: Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler named prepare. Cause: java.lang.NoSuchMethodException: org.apache.ibatis.executor.statement.StatementHandler.prepare(java.sql.Connection)] with root cause 问题

很急!!! java.lang.NoClassDefFoundError: com.android.volley.toolbox.Volley

============问题描述============ 日志文件如下,不知道是什么原因报如下错误 08-01 16:33:35.001: E/AndroidRuntime(31240): FATAL EXCEPTION: main 08-01 16:33:35.001: E/AndroidRuntime(31240): Process: cn.phonecms.main, PID: 31240 08-01 16:33:35.001: E/AndroidRuntime(31240): java.

java.lang.NoSuchMethodException 错误

报错: Stacktraces java.lang.NoSuchMethodException: com.gssw.action.ProAction.update() java.lang.Class.getMethod(Class.java:1607) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.j

java.lang.NoSuchMethodException:com.yxq.action.AdminAction.addGoods()《转载》

java.lang.NoSuchMethodException:com.yxq.action.AdminAction.addGoods()   在学习struts2的时有时会出现此异常,现将其总结如下,方便大家参考: 1. 先尝试下看其它的方法能不能用,要是都是这种情况的话,可能是你的Action类没有继承structs里面的DispatchAction或者其它的类.还有你注意下方法的参数列表,类型顺序要正确才行,是按照以下顺序的:ActionMapping mapping,ActionForm