Since I implemented some error tracking & reporting in my Yahtzee app, I'm getting some "java.lang.NullPointerException" reports back. The stack trace looks like this:
If I look through my main.java file, the lines referred to in the trace are:
com.airlinemates.yahtzee.main$WaitForLayout.run(main.java:76)
com.airlinemates.yahtzee.main.access$100(main.java:16)
com.airlinemates.yahtzee.main.afterFirstLayout(main.java:98)
com.airlinemates.yahtzee.main._activity_create(main.java:458)
(the code is obfuscated, but this is the initialization for the ExceptionEx object)
I can't see anything here that should be causing a null pointer exception, however one thing I did notice is that over time, my activity.loadlayout() call has ended up a few lines down in the Activity_Create code. Is there a requirement that the loadlayout be called first? There is nothing (that I can see) in the code that comes before the loadlayout call that relies on anything in the layout, so I don't think that's the issue. The only thing I just noticed is that the layout is saved as "yahtzee-small", but the loadlayout uses "Yahtzee-small" for the layout name. Is it case sensitive on some devices? It hasn't been an issue on any of my devices & I'm not getting thousands of reports of this error (there are about 40K current installs of the app) - so I'm wondering if perhaps it's device specific.
Thanks - Colin.
anywheresoftware.b4a.agraham.threading.Threading$ExceptionWrapper.Initialize(Threading.java:380)
com.airlinemates.yahtzee.main._activity_create(main.java:458)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:511)
anywheresoftware.b4a.BA.raiseEvent2(BA.java:173)
com.airlinemates.yahtzee.main.afterFirstLayout(main.java:98)
com.airlinemates.yahtzee.main.access$100(main.java:16)
com.airlinemates.yahtzee.main$WaitForLayout.run(main.java:76)
android.os.Handler.handleCallback(Handler.java:725)
android.os.Handler.dispatchMessage(Handler.java:92)
android.os.Looper.loop(Looper.java:137)
android.app.ActivityThread.main(ActivityThread.java:5293)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:511)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
dalvik.system.NativeStart.main(Native Method)
If I look through my main.java file, the lines referred to in the trace are:
com.airlinemates.yahtzee.main$WaitForLayout.run(main.java:76)
B4X:
mostCurrent.afterFirstLayout();
com.airlinemates.yahtzee.main.access$100(main.java:16)
B4X:
public class main extends Activity implements B4AActivity{
com.airlinemates.yahtzee.main.afterFirstLayout(main.java:98)
B4X:
processBA.raiseEvent2(null, true, "activity_create", false, isFirst);
com.airlinemates.yahtzee.main._activity_create(main.java:458)
B4X:
mostCurrent._vvvvvvvvvvvvvvvvvvvv6.Initialize("");
I can't see anything here that should be causing a null pointer exception, however one thing I did notice is that over time, my activity.loadlayout() call has ended up a few lines down in the Activity_Create code. Is there a requirement that the loadlayout be called first? There is nothing (that I can see) in the code that comes before the loadlayout call that relies on anything in the layout, so I don't think that's the issue. The only thing I just noticed is that the layout is saved as "yahtzee-small", but the loadlayout uses "Yahtzee-small" for the layout name. Is it case sensitive on some devices? It hasn't been an issue on any of my devices & I'm not getting thousands of reports of this error (there are about 40K current installs of the app) - so I'm wondering if perhaps it's device specific.
Thanks - Colin.