Android异常:android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. 出现这个异常的原因是你在子线程中修改了主线程中的组件的状态或数据..翻译过来就是:只有创建这个控件的线程才能去更新该控件的内容. android规定:只有在原始线程中(主线程,UI线程)才能修改显示组件. 解决方…
在Android平台下,进行多线程编程时,经常需要在主线程之外的一个单独的线程中进行某些处理,然后更新用户界面显示.但是,在主线线程之外的线程中直接更新页面显示的问题是 报异常:android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. [只有原始创建这个视图层次(view hierachy)的线程…
使用Tabhost的时候经常报:could not create tab content because could not find view with id 错误. 总结一下发生错误的原因,一般的发生在 setContent(); 先看XML布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android…
1:错误日志 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.8.activity.RecordActivity}: android.view.InflateException: Binary XML file line #167: Binary XML file line #167: Error inflating class <unknown> at android.app.ActivityThr…
今天在做项目开发时遇到这么一个错误,完整的错误提示信息如下: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tony.timepicker/com.tony.timepicker.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class com.tony.timepicke…
========4 关于android的一个常见错误:Unable to add window --token is not valid android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@41791b20 is not valid; is your activity running?at android.view.ViewRootImpl…
原博客地址:http://aijiawang-126-com.javaeye.com/blog/662336 在Activity中newSpinner是我把mContext传入,但是出了 android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application这个错误,参考了达人的文章终于搞定. private Context mcontext; @Ov…
最近做View的多点触控时,每次第一次触控事件完美运行,第二次就直接崩了,错误信息如下: 01-03 00:05:44.220 4377-4410/system_process E/AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: android.ui java.lang.IllegalArgumentException: pointerIndex out of range at android.view.MotionEvent.nat…
编译出错: out/target/common/obj/PACKAGING/public_api.txt:22549: error 17: Field android.view.KeyEvent.KEYCODE_STAR has changed value from 17 to 227 out/target/common/obj/PACKAGING/public_api.txt:22636: error 17: Field android.view.KeyEvent.KEYCODE_POUND…
之前遇到过这样的问题, 04-12 10:40:33.302: E/AndroidRuntime(17213): Caused by: android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application 04-12 10:40:33.302: E/AndroidRuntime(17213): at android.view.ViewRoot.setVie…
虽然是小问题一个,但也困扰了我一段时间,现在记下来,给自己做个备忘,也可以给其他人一个参考 view plaincopy to clipboardprint? 01-08 01:49:27.874: ERROR/WindowManager(473): Activity com.photos.MainActivity has leaked window android.widget.ImageButton@43e40d10 that was originally added here 01-08 …
本来就是把fragment写死在activity的xml模板里面,结果报了这个错误, Unable to start activity ComponentInfo{com.example.administrator.myapplication/com.example.administrator.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #0: Binary XM,,下面找到了解…