android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
05-12 14:18:23.866: W/System.err(31246): at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6355)
05-12 14:18:23.866: W/System.err(31246): at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:910)
05-12 14:18:23.866: W/System.err(31246): at android.view.ViewGroup.invalidateChild(ViewGroup.java:4799)
05-12 14:18:23.866: W/System.err(31246): at android.view.View.invalidateInternal(View.java:12025)
05-12 14:18:23.866: W/System.err(31246): at android.view.View.invalidate(View.java:11989)
05-12 14:18:23.866: W/System.err(31246): at android.view.View.invalidate(View.java:11973)
05-12 14:18:23.866: W/System.err(31246): at android.widget.TextView.checkForRelayout(TextView.java:7180)
05-12 14:18:23.866: W/System.err(31246): at android.widget.TextView.setText(TextView.java:4293)
05-12 14:18:23.866: W/System.err(31246): at android.widget.TextView.setText(TextView.java:4147)
05-12 14:18:23.866: W/System.err(31246): at android.widget.TextView.setText(TextView.java:4122)
05-12 14:18:23.866: W/System.err(31246): at com.xiu8.android.dialog.ChargeDialog.updateData(ChargeDialog.java:96)
05-12 14:18:23.866: W/System.err(31246): at com.xiu8.android.dialog.ChargeDialog.access$0(ChargeDialog.java:91)
05-12 14:18:23.866: W/System.err(31246): at com.xiu8.android.dialog.ChargeDialog$1.handler(ChargeDialog.java:83)
05-12 14:18:23.866: W/System.err(31246): at com.vlee78.android.vl.VLAsyncHandler$1.process(VLAsyncHandler.java:131)
05-12 14:18:23.866: W/System.err(31246): at com.vlee78.android.vl.VLScheduler$BlockItem.run(VLScheduler.java:33)
05-12 14:18:23.866: W/System.err(31246): at android.os.Handler.handleCallback(Handler.java:739)
05-12 14:18:23.866: W/System.err(31246): at android.os.Handler.dispatchMessage(Handler.java:95)
05-12 14:18:23.866: W/System.err(31246): at android.os.Looper.loop(Looper.java:135)
05-12 14:18:23.866: W/System.err(31246): at android.app.ActivityThread.main(ActivityThread.java:5536)
05-12 14:18:23.866: W/System.err(31246): at java.lang.reflect.Method.invoke(Native Method)
05-12 14:18:23.866: W/System.err(31246): at java.lang.reflect.Method.invoke(Method.java:372)
05-12 14:18:23.866: W/System.err(31246): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1397)
05-12 14:18:23.866: W/System.err(31246): at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6355)
05-12 14:18:23.866: W/System.err(31246): at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:910)
05-12 14:18:23.866: W/System.err(31246): at android.view.ViewGroup.invalidateChild(ViewGroup.java:4799)
05-12 14:18:23.866: W/System.err(31246): at android.view.View.invalidateInternal(View.java:12025)
05-12 14:18:23.866: W/System.err(31246): at android.view.View.invalidate(View.java:11989)
05-12 14:18:23.866: W/System.err(31246): at android.view.View.invalidate(View.java:11973)
05-12 14:18:23.866: W/System.err(31246): at android.widget.TextView.checkForRelayout(TextView.java:7180)
05-12 14:18:23.866: W/System.err(31246): at android.widget.TextView.setText(TextView.java:4293)
05-12 14:18:23.866: W/System.err(31246): at android.widget.TextView.setText(TextView.java:4147)
05-12 14:18:23.866: W/System.err(31246): at android.widget.TextView.setText(TextView.java:4122)
05-12 14:18:23.866: W/System.err(31246): at com.xiu8.android.dialog.ChargeDialog.updateData(ChargeDialog.java:96)
05-12 14:18:23.866: W/System.err(31246): at com.xiu8.android.dialog.ChargeDialog.access$0(ChargeDialog.java:91)
05-12 14:18:23.866: W/System.err(31246): at com.xiu8.android.dialog.ChargeDialog$1.handler(ChargeDialog.java:83)
05-12 14:18:23.866: W/System.err(31246): at com.vlee78.android.vl.VLAsyncHandler$1.process(VLAsyncHandler.java:131)
05-12 14:18:23.866: W/System.err(31246): at com.vlee78.android.vl.VLScheduler$BlockItem.run(VLScheduler.java:33)
05-12 14:18:23.866: W/System.err(31246): at android.os.Handler.handleCallback(Handler.java:739)
05-12 14:18:23.866: W/System.err(31246): at android.os.Handler.dispatchMessage(Handler.java:95)
05-12 14:18:23.866: W/System.err(31246): at android.os.Looper.loop(Looper.java:135)
05-12 14:18:23.866: W/System.err(31246): at android.app.ActivityThread.main(ActivityThread.java:5536)
05-12 14:18:23.866: W/System.err(31246): at java.lang.reflect.Method.invoke(Native Method)
05-12 14:18:23.866: W/System.err(31246): at java.lang.reflect.Method.invoke(Method.java:372)
05-12 14:18:23.866: W/System.err(31246): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1397)
05-12 14:18:23.866: W/System.err(31246): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1192)
一般是控件的初始化个状态更新不在同一个线程。
8-13 18:29:22.924: E/AndroidRuntime(1875): Caused by: Java.lang.ClassNotFoundException:XXXXX in loader dalvik.system.PathClassLoader[/data/app/XXXX.apk]
我想大家经常因为疏忽出现ClassNotFoundException的异常,这个异常在Android开发中无非就是告诉你类没有找到,那么什么原因导致没找到呢?
其实一般分为2种情况:
1、启动activity的时候,在AndroidManifest.xml 可能压根你就忘了添加一个activity,或者说activity的包名或者名字写错了,这个犯错几率很高的
2、你的使用的class,是一个外部的JAR包,当在工程中编译使用时,发布成APK并没有包含JAR文件,所以APK在执行的时候就找不到JAR文件,会报错。
所以一定在“Order and Export”里,勾选使用的jar包。切记!