直接放上我的代码。希望能给碰到相同问题的朋友提供帮助

	    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()的更多相关文章

  1. [Android]Can't create handler inside thread that has not called Looper.prepare()

    更新是由于在新的线程来打开UI只有一个错误.子线程更新主线程UI需要使用Handler. 还有比如今天出现以下错误.码,如以下: send.setOnClickListener(new OnClick ...

  2. 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报 ...

  3. 在子线程中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 ...

  4. 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 ...

  5. 关于子线程使用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 ...

  6. Can’t create handler inside thread that has not called Looper.prepare()

    1)在Android 2.3以前,为防止ANR(Application Not Responding),Google是不赞成将网络连接等一系列耗时操作直接放到应用主线程进行的,推荐将这类操作放在子线程 ...

  7. 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 ...

  8. Android handler 报错处理Can't create handler inside thread that has not called Looper.prepare()

    问题: 写了一个sdk给其他人用,提供一个回调函数,函数使用了handler处理消息 // handler监听网络请求,完成后操作回调函数 final Handler trigerGfHandler ...

  9. 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消息传递机制 ...

随机推荐

  1. nginx实现openfire负载均衡

    Nginx版本必须是1.9以上,不然不支持tcp连接,要么加入其他插件 在nginx.conf文件中加入下图中的代码,图中的ip与端口配成自己的,配置好后,客户端请求listen监听的端口,ip为ng ...

  2. android mount win2008 nfs

    win2008下添加NFS 安卓下运行(需要安装busybox 还有root) busybox mount -t nfs 192.168.1.2:/NFS /nfs -o nolock

  3. 修改elementUI组件样式无效的问题研究

    问题背景:el-tabs的选项卡默认字体是14px,大了,想改成12px,结果在style里面加样式总是不生效. 解决:样式放到app.vue里面,样式就生效了 .panel-content .el- ...

  4. 使用 Python 创建你自己的 Shell (上)

    我很想知道一个 shell (像 bash,csh 等)内部是如何工作的.于是为了满足自己的好奇心,我使用 Python 实现了一个名为yosh(Your Own Shell)的 Shell.本文章所 ...

  5. Code a simple telnet client using sockets in python

    测试端口是否开放的python脚本 原文: https://www.binarytides.com/code-telnet-client-sockets-python/ 配置: 120.79.14.8 ...

  6. keepalived的脑裂问题

    keepalived的脑裂问题 学习了:http://blog.51cto.com/10630401/2089847 split-brain 无HA不脑裂

  7. 转: SVN使用教程总结(图文丰富,相当详细)

    转自:http://www.cnblogs.com/armyfai/p/3985660.html SVN使用教程总结   SVN简介: 为什么要使用SVN? 程序员在编写程序的过程中,每个程序员都会生 ...

  8. xampp下载地址 一个集成的易于安装的WEB环境部署包

    XAMPP(Apache+MySQL+PHP+PERL)是一个功能强大的建站集成软件包.这个软件包原来的名字是 LAMPP,但是为了避免误解,最新的几个版本就改名为 XAMPP 了.它可以在Windo ...

  9. [ES6] 03. The let keyword -- 1

    var message = "Hi"; { var message = "Bye"; } console.log(message); //Bye The mes ...

  10. 会说话的HTML--语义化杂谭-TGideas-腾讯游戏官方设计团队

    家里有个熊孩子,经常会有一些意想不到的事情发生:回家的时候,他会笑呵呵冲过来,大声喊着“臭爸爸”:你让他把鞋穿上,他会提起鞋子往楼下扔...在小孩的世界里,他虽然会说话,但不一定明白其中的意思,不能正 ...