子线程Handler sendMessage 报错 Attempt to invoke virtual method '

博客内容提到了Android开发中子线程Handler使用时出现的错误,错误原因是未在子线程启动前正确使用。解决方案是在onCreate方法内启动Thread,并确保传递正确的参数。同时,博主推荐了其老师的人工智能教程,适合零基础学习。
摘要由CSDN通过智能技术生成

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

                03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime: FATAL EXCEPTION: main
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime: Process: tech.androidstudio.tulingdemo, PID: 16029
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime: java.lang.IllegalStateException: Could not execute method for android:onClick
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime:     at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:275)
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime:     at android.view.View.performClick(View.java:4761)
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime:     at android.view.View$PerformClick.run(View.java:19767)
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:739)
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:95)
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:135)
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5310)
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:372)
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
03-17 08:10:18.760 16029-16029/tech.androidstudio.tulingdemo E/AndroidRuntime:  Caused by: java.lang.reflect.InvocationTargetException
03-17 08:10:18.760 16029-160
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值