How to solve fatal exception
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.
精彩评论