AVD 4.0.3中出现的灵异事件,期待来者

来源:互联网 发布:cg绘画软件 编辑:程序博客网 时间:2024/05/01 02:08
每次eclipse中重新运行项目,都会报下面这个NULL POINTER ,虽然不影响什么,但是看到LOGCAT里那堆错误信息,很烦人。不知是什么原因导致的?
?
代码片段,双击复制
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19


08-0213:14:59.686: E/AndroidRuntime(965): FATAL EXCEPTION: main
08-0213:14:59.686: E/AndroidRuntime(965): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
08-0213:14:59.686: E/AndroidRuntime(965):         at android.app.LoadedApk.makeApplication(LoadedApk.java:482)
08-0213:14:59.686: E/AndroidRuntime(965):         at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3938)
08-0213:14:59.686: E/AndroidRuntime(965):         at android.app.ActivityThread.access$1300(ActivityThread.java:123)
08-0213:14:59.686: E/AndroidRuntime(965):         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
08-0213:14:59.686: E/AndroidRuntime(965):         at android.os.Handler.dispatchMessage(Handler.java:99)
08-0213:14:59.686: E/AndroidRuntime(965):         at android.os.Looper.loop(Looper.java:137)
08-0213:14:59.686: E/AndroidRuntime(965):         at android.app.ActivityThread.main(ActivityThread.java:4424)
08-0213:14:59.686: E/AndroidRuntime(965):         at java.lang.reflect.Method.invokeNative(Native Method)
08-0213:14:59.686: E/AndroidRuntime(965):         at java.lang.reflect.Method.invoke(Method.java:511)
08-0213:14:59.686: E/AndroidRuntime(965):         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-0213:14:59.686: E/AndroidRuntime(965):         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-0213:14:59.686: E/AndroidRuntime(965):         at dalvik.system.NativeStart.main(Native Method)
08-0213:14:59.686: E/AndroidRuntime(965): Caused by: java.lang.NullPointerException
08-0213:14:59.686: E/AndroidRuntime(965):         at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:362)
08-0213:14:59.686: E/AndroidRuntime(965):         at android.app.LoadedApk.getClassLoader(LoadedApk.java:305)
08-0213:14:59.686: E/AndroidRuntime(965):         at android.app.LoadedApk.makeApplication(LoadedApk.java:474)
08-0213:14:59.686: E/AndroidRuntime(965):         ... 11more




虽然不影响程序运行,但是看着一堆错误不爽。解决办法:


 <com.gem.hsx.util.MarqueeText            android:id="@+id/file_name"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:ellipsize="marquee"            android:focusable="true"            android:focusableInTouchMode="true"            android:marqueeRepeatLimit="marquee_forever"            android:scrollHorizontally="true"            android:singleLine="true"                      android:textSize="15sp" />

看看自己的程序中有没有这个,如果有请确定
com.gem.hsx.util.MarqueeText   包名类名写的正确

原创粉丝点击