开发者

How to solve fatal exception

开发者 https://www.devze.com 2023-02-20 14:35 出处:网络
WARN/dalvikvm(4645): threadid=7: thread exiting with uncaught exception (group=0x4001d800) ERROR/AndroidRuntime(4645): FATAL EXCEPTION: Timer-0
    WARN/dalvikvm(4645): threadid=7: thread exiting with uncaught exception (group=0x4001d800)
    ERROR/AndroidRuntime(4645): FATAL EXCEPTION: Timer-0
    ERROR/AndroidRuntime(4645): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
    ERROR/AndroidRuntime(4645):     at android.os.Handler.<init>(Handler.java:121)
    ERROR/AndroidRuntime(4645):     at android.widget.Toast.<init>(Toast.java:68)
    ERROR/AndroidRuntime(4645开发者_运维知识库):     at android.widget.Toast.makeText(Toast.java:231)
    ERROR/AndroidRuntime(4645):     at com.example.Task.jokedescription$1.run(jokedescription.java:186)
    ERROR/AndroidRuntime(4645):     at java.util.Timer$TimerImpl.run(Timer.java:289)
    WARN/ActivityManager(59):   Force finishing activity com.example.Task/.jokedescription


You are trying to show a Toast not from main (UI) thread.

Please post the snippet of code you have exception in.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号