今天发现一个界面setText 的时候出现了这个问题,看到报错,大致就是界面还没创建呢,就使用seText 了

这个是自己的理解, 处理方法就是 添加一个延时操作,

                                runOnUiThread(new Runnable() {@Overridepublic void run() {mainActicityCity.setText(cityName);}});

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解决方案

    Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that c ...

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

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

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

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

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

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

  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. Eclipse编译运行Native代码步骤详解
  2. 阿里巴巴P9大佬雷卷与中间件小哥重新定义:高段位程序员的学习之道
  3. 动态规划生产存储matlab,基于Matlab的动态规划算法的实现及应用
  4. linux网络编程之用socket实现简单客户端和服务端的通信(基于UDP)
  5. 数学模型让咖啡更好喝
  6. 【Spark Summit East 2017】可扩展性机器学习的特征哈希
  7. android 布局中的单位及分辨率自解
  8. 原型工具MockingBot 墨刀
  9. 单片机应用系统设计技术——单片机出租车计费器
  10. Allatori混淆器的介绍以及使用方法
  11. volatility 基本用法
  12. mtp android7,Android7.0修改手机型号,mtp名称等
  13. opencv-python 中文显示在图像上
  14. 银行外汇资金业务学习笔记(3)spot rate (即期汇率)和 forward rate(远期汇率)
  15. android 仿微视,腾讯微视和抖音一样?模仿还是照搬?
  16. 关于STM32f103c8t6串口下载问题解决
  17. mysql-日志分析
  18. (吊灯止损和YOYO止损) --- ATR作为入场工具的应用示例
  19. Windows 10中的Docker实践
  20. 新奥股份2019年经营性现金流和主营业务收入稳健增长

热门文章

  1. 人工智能3d建模算法_打破国外垄断,全国产3D芯片为机器人“点睛”
  2. Go 学习笔记(82)— Go 第三方库之 viper(解析配置文件、热更新配置文件)
  3. 机房收费系统【VB版】——添加和删除用户
  4. 【VB】学生信息管理系统6——错误调试
  5. LeetCode简单题之实现 strStr()
  6. LeetCode中等题之特殊等价字符串组
  7. 定制语音代理(智能体)的背后是什么?
  8. Java基础入门语法和安装
  9. [C] Dijkstra算法——通过边实现松弛
  10. 火狐浏览器允许ajax,解决火狐浏览器发送jquery的ajax请求无效的问题