I have problem running my app on Android 2.3 (Gingerbread). The app has a splash screen and timer, and then it runs
the main class. It works fine on Android 2.2 (Froyo), Android 2.1 (Eclair), etc. It just crashes on Android 2.3.
Do I need to create another thread than the main activity thread?
Here is the error below:
java.lang.RuntimeException: Unable to start activity
java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
I found it. It turned out my background image was too big. That’s why my app crashed on create, because it took longer time to load which triggered the UI thread runtimeerror.