使用ClipboardManager碰到Can't create handler inside thread that has not called Looper.prepare()

来源:互联网 发布:北京java外包公司 编辑:程序博客网 时间:2024/06/05 17:59

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

    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);


0 0
原创粉丝点击