0
在我的應用程序中,我有三個PNG文件作爲活動的背景,放在文件夾drawable-nodpi中,但應用程序在平板電腦Samsung Galaxy Tab 2 10.1上崩潰,我用它測試,給我這個錯誤:錯誤無法啓動活動
的logcat:
E/AndroidRuntime(4846): FATAL EXCEPTION: main
E/AndroidRuntime(4846): java.lang.RuntimeException: Unable to start activity ComponentInfo{it.bisemanuDEV.mathTools/it.bisemanuDEV.mathTools.MainActivity}: java.lang.NullPointerException
E/AndroidRuntime(4846): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
E/AndroidRuntime(4846): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
E/AndroidRuntime(4846): at android.app.ActivityThread.access$600(ActivityThread.java:140)
E/AndroidRuntime(4846): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
E/AndroidRuntime(4846): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(4846): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(4846): at android.app.ActivityThread.main(ActivityThread.java:4895)
E/AndroidRuntime(4846): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(4846): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(4846): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
E/AndroidRuntime(4846): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
E/AndroidRuntime(4846): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(4846): Caused by: java.lang.NullPointerException
E/AndroidRuntime(4846): at it.bisemanuDEV.mathTools.MainActivity.onCreate(MainActivity.java:53)
E/AndroidRuntime(4846): at android.app.Activity.performCreate(Activity.java:5163)
E/AndroidRuntime(4846): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
E/AndroidRuntime(4846): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
但是,應用程序適用於智能手機的不同車型。 可能是什麼問題?
發佈你的代碼,你的'MainActivity'中的第53行是什麼? – Pragnani 2013-05-12 16:57:37
在MainActivity中發佈你的onCreate方法 – GVillani82 2013-05-12 16:58:34