码迷,mamicode.com
首页 > 编程语言 > 详细

Caused by: java.lang.NoSuchMethodException:

时间:2015-10-26 17:05:53      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:

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/AndroidRuntime: java.lang.IllegalStateException: Could not find a method onClike(View) in the activity class android.view.ContextThemeWrapper for onClick handler on view class android.widget.Button

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.view.View$1.onClick(View.java:4043)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.view.View.performClick(View.java:4811)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.view.View$PerformClick.run(View.java:20136)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:815)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:104)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:194)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5546)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:372)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:  Caused by: java.lang.NoSuchMethodException: onClike [class android.view.View]

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at java.lang.Class.getMethod(Class.java:664)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at java.lang.Class.getMethod(Class.java:643)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.view.View$1.onClick(View.java:4036)

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.view.View.performClick(View.java:4811) 

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.view.View$PerformClick.run(View.java:20136) 

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:815) 

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:104) 

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:194) 

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5546) 

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:372) 

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964) 

10-26 16:13:34.047 27343-27343/com.zaizai.safty E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759) 

经过百度,google终于解决了

在布局文件中不能使用

android:theme="@style/AppTheme.NoActionBar"

去掉即可

Caused by: java.lang.NoSuchMethodException:

标签:

原文地址:http://my.oschina.net/zaizaiangels/blog/522199

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!