使用ClipboardManager碰到Can't create handler inside thread that has not called Looper.prepare()
直接放上我的代码。希望能给碰到相同问题的朋友提供帮助
Runnable runnable = new Runnable() {
public void run() {
ClipboardManager clipboard = (ClipboardManager)GameUtil.getIntance().getContext().getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setText(content);
}
};
GameUtil.getIntance().getGameActiviti().runOnUiThread(runnable);
使用ClipboardManager碰到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()
更新是由于在新的线程来打开UI只有一个错误.子线程更新主线程UI需要使用Handler. 还有比如今天出现以下错误.码,如以下: send.setOnClickListener(new OnClick ...
- Android进阶(十六)子线程调用Toast报Can't create handler inside thread that has not called Looper.prepare() 错误
原子线程调用Toast报Can't create handler inside thread that has not called Looper.prepare() 错误 今天用子线程调Toast报 ...
- 在子线程中new Handler报错--Can't create handler inside thread that has not called Looper.prepare()
在子线程中new一个Handler为什么会报以下错误? java.lang.RuntimeException: Can't create handler inside thread that has ...
- Android 线程更新UI报错 : Can't create handler inside thread that has not called Looper.prepare()
MainActivity中有一个按钮,绑定了save方法 public void save(View view) { String title = titleText.getText().toStri ...
- 关于子线程使用Toast报错Can't create handler inside thread that has not called Looper.prepare()的解决办法
形同如下代码,在Thread中调用Toast显示错误信息: new Thread(new Runnable(){ @Override public void run() { try{ weatherD ...
- Can’t create handler inside thread that has not called Looper.prepare()
1)在Android 2.3以前,为防止ANR(Application Not Responding),Google是不赞成将网络连接等一系列耗时操作直接放到应用主线程进行的,推荐将这类操作放在子线程 ...
- Android-java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
章出自:luchg技术交流 http://www.luchg.com 版权所有.本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源,谢谢. Android-java.lang.Runti ...
- Android handler 报错处理Can't create handler inside thread that has not called Looper.prepare()
问题: 写了一个sdk给其他人用,提供一个回调函数,函数使用了handler处理消息 // handler监听网络请求,完成后操作回调函数 final Handler trigerGfHandler ...
- Android进阶(八)Can't create handler inside thread that has not called Looper.prepare()
Error:Can't create handler inside thread that has not called Looper.prepare() 原代码: //利用Handler消息传递机制 ...
随机推荐
- Birt中实现字段拆分为表的还有一种方法
来源: http://developer.actuate.com/community/forum/index.php? /topic/36204-split-data-row/. 将字段拆分为 ...
- OpenCV使用FLANN进行特征点匹配
使用FLANN进行特征点匹配 目标 在本教程中我们将涉及以下内容: 使用 FlannBasedMatcher 接口以及函数 FLANN 实现快速高效匹配( 快速最近邻逼近搜索函数库(Fast Appr ...
- Spark RDD API扩展开发
原文链接: Spark RDD API扩展开发(1) Spark RDD API扩展开发(2):自定义RDD 我们都知道,Apache Spark内置了很多操作数据的API.但是很多时候,当我们在现实 ...
- 漏洞预警 | ECShop全系列版本远程代码执行高危漏洞
2018年9月1日,阿里云态势感知发布预警,近日利用ECShop全系列版本的远程代码执行漏洞进行批量化攻击量呈上升趋势.该漏洞利用简单且危害较大,黑客可通过WEB攻击直接获得服务器权限. 漏洞原理 该 ...
- Ubuntu 12.04 LTS安装Windows字体
内容参考自别人的博客:http://www.cnblogs.com/zhj5chengfeng/p/3251009.html 1. 为了方便,先将Windows字体拷贝到~/WinFonts下. 我是 ...
- Android -- sqlite数据库随apk发布
背景 把在工程中测 ...
- 【Networking】Libevent客户端例子
[原]Libevent客户端例子 时间 -- :: luotuo44的专栏 原文 http://blog.csdn.net/luotuo44/article/details/34416429 主题 l ...
- Google帮助IE浏览器实现对SVG支持
可缩放矢量图形(SVG)的意识就是一个用于描述二维矢量图形的一种开放图形格式. SVG现在已经能够广泛得应用到许多的项目当中,包括KDE和维基百科等.但是 Internet Explorer浏览器的内 ...
- function.length和arguments的区别
function.length:接收到函数体外的参数计算长度 arguments:接收到函数体内的参数计算长度 /** * 函数参数长度和伪数组(arguments)长度不一样! -> 接收到函 ...
- canvas的api
Canvas API(画布)用于在网页实时生成图像,并且可以操作图像内容,基本上它是一个可以用JavaScript操作的位图(bitmap).使用前,首先需要新建一个canvas网页元素. 1 2 3 ...