0
我试图显示线程中的Toast。在Android中创建一个内部线程处理程序
Toast.makeText(activity.getApplicationContext(), "This is the Toast message", Toast.LENGTH_LONG).show();
但抛出异常
java.lang.RuntimeException:Can't create a handler inside thread that has not called Looper.prepare().
我该如何解决这个问题?我已将Looper.myLooper().prepare();
放在Toast.makeText(....).show();
之前
当我完成此操作后,它不会抛出异常但不显示任何Toast消息。
那么我该如何解决这个问题呢?
在此先感谢。