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

最佳答案

您正在尝试显示不来自主(UI)线程的Toast。

请发布您有例外的代码段。

10-07 16:22