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

	    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. Jacob的使用出错总结

    转自:http://blog.163.com/wm_at163/blog/static/13217349020114166447941/ Jacob的使用方法: 1.在工程中导入 jacob.jar ...

  2. iOS: FFmpeg的使用二

    1.下载并编译FFMPEG. https://github.com/kewlbear/FFmpeg-iOS-build-script 下载后有一个build-ffmpeg.sh文件.终端执行即可自动下 ...

  3. POJ 2046 Gap 搜索- 状态压缩

    题目地址: http://poj.org/problem?id=2046 一道搜索状态压缩的题目,关键是怎样hash. AC代码: #include <iostream> #include ...

  4. 数学图形(2.17)pappus螺线

    帕波斯(Pappus of Alexandria) 生于亚历山大,活跃于公元300—350前后.该螺线是一种绕在圆锥上的曲线. #http://www.mathcurve.com/courbes3d/ ...

  5. longest-palindrome

    https://leetcode.com/problems/longest-palindrome/ public class Solution { public int longestPalindro ...

  6. Django admin管理

    admin的配置 admin是django强大功能之一,它能共从数据库中读取数据,呈现在页面中,进行管理.默认情况下,它的功能已经非常强大,如果你不需要复杂的功能,它已经够用,但是有时候,一些特殊的功 ...

  7. Xamarin C# Android for Windows 安装

    Xamarin C# Android for Windows  安装 Xamarin的. Android手动安装 安装Xamarin的  Android在Windows机器上   大多数时候,Xama ...

  8. (剑指Offer)面试题58:二叉树的下一个结点

    题目: 给定一个二叉树和其中的一个结点,请找出中序遍历顺序的下一个结点并且返回.注意,树中的结点不仅包含左右子结点,同时包含指向父结点的指针. 思路: 考虑中序遍历的过程, 如果当前结点存在右子节点, ...

  9. docker桥接

    Ifconfig docker0 down Brctl delvr docker0 进入到网卡配置文件 修改eth0网卡参数 加入BIRDGE=br0 创建一个br0 其中ip为真实机的ip 更改do ...

  10. Android研究之动态创建UI界面具体解释

     Android的基本UI界面一般都是在xml文件里定义好,然后通过activity的setContentView来显示在界面上.这是Android UI的最简单的构建方式.事实上,为了实现更加复 ...