Android开发Can't create handler inside thread that has not called Looper.prepare()
来源:互联网 发布:tor网络 原理 编辑:程序博客网 时间:2024/05/15 05:38
public void onResponse(final Response response) throws IOException {
Toast.makeText(MainActivity.this, "test.", Toast.LENGTH_SHORT).show();
}
在线程中加入Toast提示,出现如下error:
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
修改后:
public void onResponse(final Response response) throws IOException {Looper.prepare();
Toast.makeText(MainActivity.this, "d", Toast.LENGTH_SHORT).show();Looper.loop();
}即可正常运行。
0 0
- Android开发Can't create handler inside thread that has not called Looper.prepare()
- Android开发报错 Can't create handler inside thread that has not called Looper.prepare()
- Android开发报Can't create handler inside thread that has not called Looper.prepare()错误
- Android开发报错 Can't create handler inside thread that has not called Looper.prepare()
- Unity-Android: Can't create handler inside thread that has not called Looper.prepare()
- Android 错误提示: Can't create handler inside thread that has not called Looper.prepare()
- android之Can't create handler inside thread that has not called Looper.prepare()
- android can't create handler inside thread that has not called Looper.prepare()解决方案
- [Android]Can't create handler inside thread that has not called Looper.prepare()
- Android 报Can't create handler inside thread that has not called Looper.prepare()错误!
- Android中的Can't create handler inside thread that has not called Looper.prepare()异常
- Android进阶(八)Can't create handler inside thread that has not called Looper.prepare()
- Android : Can't create handler inside thread that has not called Looper.prepare() 异常
- android -- Can't create handler inside thread that has not called Looper.prepare()
- Android : Can't create handler inside thread that has not called Looper.prepare()
- Android java.lang.RuntimeException: Can\'t create handler inside thread that has not called Looper.prepare()
- android异常收集-Can't create handler inside thread that has not called Looper.prepare()
- Android开发:Can't create handler inside thread that has not called Looper.prepare() 异常的解决方案
- leetcode-257-Binary Tree Paths
- Cg Programming/Unity/Transparency
- 81.You are currently located in Singapore and have connected to a remote database in Chicago.
- java.lang.String类分析
- 设计模式(7)——适配器模式(Adapter Pattern)
- Android开发Can't create handler inside thread that has not called Looper.prepare()
- css 页脚固定到底部
- c语言二叉树的存储表示与实现
- Home Screen Quick Actions
- sqlserver 从txt文件入库
- memcached安装
- Spark Streaming和Kafka整合是如何保证数据零丢失
- 设计模式(8)——桥接模式(Bridge Pattern)
- iOS学习----------AFNetworking(5)NSURLSessionTask创建