我在我的 Eclipse 中有一个项目,我为所有包使用了多个具有相同前缀的包。这是结构的截图!
问题是,当我运行应用程序时,我收到以下错误消息:
无法启动活动 ComponentInfo{com.td.bookshelf/com.td.bookshelf.SplashActivity}:java.lang.NullPointerException)
我已经手动添加了所有包并从另一个项目中复制了类文件。因此,我清理了构建项目并重新启动了 Eclipse,但徒劳无功。
请帮助我摆脱错误。
08-22 13:43:07.367: E/AndroidRuntime(4900): FATAL EXCEPTION: main
08-22 13:43:07.367: E/AndroidRuntime(4900): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.td.bookshelf/com.td.bookshelf.SplashActivity}: java.lang.NullPointerException
08-22 13:43:07.367: E/AndroidRuntime(4900): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
08-22 13:43:07.367: E/AndroidRuntime(4900): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
08-22 13:43:07.367: E/AndroidRuntime(4900): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-22 13:43:07.367: E/AndroidRuntime(4900): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
08-22 13:43:07.367: E/AndroidRuntime(4900): at android.os.Handler.dispatchMessage(Handler.java:99)
08-22 13:43:07.367: E/AndroidRuntime(4900): at android.os.Looper.loop(Looper.java:123)
08-22 13:43:07.367: E/AndroidRuntime(4900): at android.app.ActivityThread.main(ActivityThread.java:3687)
08-22 13:43:07.367: E/AndroidRuntime(4900): at java.lang.reflect.Method.invokeNative(Native Method)
08-22 13:43:07.367: E/AndroidRuntime(4900): at java.lang.reflect.Method.invoke(Method.java:507)
08-22 13:43:07.367: E/AndroidRuntime(4900): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
08-22 13:43:07.367: E/AndroidRuntime(4900): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
08-22 13:43:07.367: E/AndroidRuntime(4900): at dalvik.system.NativeStart.main(Native Method)
08-22 13:43:07.367: E/AndroidRuntime(4900): Caused by: java.lang.NullPointerException
08-22 13:43:07.367: E/AndroidRuntime(4900): at com.td.bookshelf.SplashActivity.onCreate(SplashActivity.java:56)
08-22 13:43:07.367: E/AndroidRuntime(4900): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-22 13:43:07.367: E/AndroidRuntime(4900): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
08-22 13:43:07.367: E/AndroidRuntime(4900): ... 11 more