Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.

此错误是在非UI线程中更新UI所造成的,解决方案如下:(注:在需要更新UI的地方调用new LongTimeTask().execute("此处为任意字符或空均可");)
private class LongTimeTask extends AsyncTask<String, Void, String> {@Overrideprotected String doInBackground(String... params) {return params[0];}@Overrideprotected void onPostExecute(String result) {//更新UI的操作,这里面的内容是在UI线程里面执行的}}

only the original thread that created a view hierarchy can touch its views解决方案相关推荐

  1. android开发 bug问题解决:Only the original thread that created a view hierarchy can touch its views

    android开发 bug问题解决:Only the original thread that created a view hierarchy can touch its views. 翻译:只有创 ...

  2. Only the original thread that created a view hierarchy can touch its views——Handler的使用

    今天写了一个更新UI的小例子,没想到出了log打印了这样一个错误:Only the original thread that created a view hierarchy can touch it ...

  3. Only the original thread that created a view hierarchy can touch its views异常

    写代码的时候碰到android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that crea ...

  4. android报错:Only the original thread that created a view hierarchy can touch its views.

    问题的报错位置是我用handler写了一个定时消息,在handleMessage()方法里直接写了ui更新操作, 这个报错的原因一般是因为在子线程中直接操作UI导致的(eg, setText()).因 ...

  5. 出现Only the original thread that created a view hierarchy can touch its views.的错误

    先看这句话的翻译哈.只有创建视图层次结构的原始线程才能触摸其视图. 一般这种错误出现在子线程中操作主线程的控件的操作中,比如更新等操作. 解决这类问题,需要使用Handler.关于Handler是什么 ...

  6. Only the original thread that created a view hierarchy can touch its views

    今天发现一个界面setText 的时候出现了这个问题,看到报错,大致就是界面还没创建呢,就使用seText 了 这个是自己的理解, 处理方法就是 添加一个延时操作, runOnUiThread(new ...

  7. Only the original thread that created a view hierarchy can touch its views.

    这个问题是由于再非主线程中更新了Android的UI,找到可能是在非主线程更新UI的方法,使用使其再handler中更新ui,问题基本上就能够解决. 转载于:https://www.cnblogs.c ...

  8. Android刷新UI导致崩溃的探究——Only the original thread

    一.原因: 非主线程使用TextView.setText(),"有时会出现"Only the original thread that created a view hierarc ...

  9. tip use view.isineditmode() in your custom views to skip code when shown in eclipse

    tip use view.isineditmode() in your custom views to skip code when shown in eclipse 转载于:https://www. ...

最新文章

  1. 大家都来说说为什么要学习jQuery Mboile?
  2. ECSHOP头部调用会员的消费积分
  3. objective c 语法
  4. OpenCV为轮廓创建边界旋转框和椭圆
  5. 我被“非结构化数据包围了”,请求支援!
  6. echart 地图 某个地区_一站式解决echarts实现区域地图
  7. 从下列选项中选择正确的java表达式,java笔试常见的选择题
  8. [项目管理]项目管理常用的七大工具
  9. windows 域,windows domain
  10. 两个坚持是什么_坚持跑步八年,90后大学生告诉你,坚持锻炼的意义
  11. 计算机与英语相关工作,计算机行业岗位英语单词整合
  12. python小游戏:添加武器,查看武器,删除武器
  13. 博弈美业SAAS系统,美业系统源码-主要功能
  14. 2022年9月电子学会Python等级考试试卷(一级)答案解析
  15. docker-镜像加速
  16. 内蒙古计算机考研学校选择,2020内蒙古考研指南-这些没有A+的院校你会选择吗...
  17. 计算机音乐谱大全好汉歌,好汉歌简谱-刘欢-电视剧《水浒传》主题曲
  18. 联想p720装系统_“多达112个框”:Lenovo 联想 推出 ThinkStation P920/P720系列 工作站...
  19. EasyExcel大批量数据导出OOM,个人案例和解决办法
  20. icode 三级训练场if入门1-10关

热门文章

  1. GSM模块_常用AT指令详解
  2. linux压缩命令-----zip
  3. 10分钟教你用python打造贪吃蛇超详细教程
  4. 如何安装SwitchyOmega
  5. OSG场景漫游(一)
  6. 山东电销机器人_青岛语音电销机器人 欢迎来电「山东启云创客网络科技供应」...
  7. seo快排工具真的有用吗?免费SEO手法网站快排技术分享
  8. Tableau Prep经验总结
  9. 【华为校招】【校招】【Java】单词搜索(DFS)
  10. 分享 9 条消除 if...else 的锦囊妙计