inside thread that has not called Looper.prepare()
handlre发送message,handleMessage中弹出吐司 创建looper对象 Looper.prepare();Toast.makeText();
■网友
把toast放到主线程上显示,不然就算你prepare了还会有另外一个错
■网友
你在子线程创建的handler
■网友
报错为:java.lang.RuntimeException: Can\u0026#39;t create handler inside thread that has not called Looper.prepare()
【inside thread that has not called Looper.prepare()】
■网友
一切ui操作都用handler切换到主线程
推荐阅读
- Note that和Notice that等价吗
- ThreadPoolExecutor当中的默认线程工厂咋有点看不懂呢
- 关于ThreadLocal中set等方法
- 物联网互通的问题,Thread、OIC这些不同协议标准有啥特点
- Java怎样为每个线程提供一个单例
- 对于Thread Pool代码里的一个疑问?
- 《Virtual Reality Insider》中译手稿开放申请,一起来拍砖改错
- 关于 Java 中 Thread 实例的 start 方法
- 现在的insider preview激活政策是怎么样的
- 怎么样在 Xcode 的 C++ 文件中使用 thread_local
