I keep having these sporatic random crashes that I cannot seem to narrow down.
I mean this is very very intermittent. only once in awhile when the App starts, this crash happens. Seems to be happening when it tries to create the menu using the CreateMenu subroutine.
Here is the crash log, and my subroutine:
Any thoughts?
I mean this is very very intermittent. only once in awhile when the App starts, this crash happens. Seems to be happening when it tries to create the menu using the CreateMenu subroutine.
Here is the crash log, and my subroutine:
B4X:
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (scoreengine) Create ***
** Service (scoreengine) Start **
releasing KeepAlive
No wakelock.
turning screen on
using partialLock
*** Service (commengine) Create ***
** Service (commengine) Start **
---- AppUpdating.ReadCurVN
UpdateComplete - time: 11:41:37
Status: -1
** Activity (main) Pause, UserClosed = false **
Cant read CommEngine variables
main_activity_createmenu (java line: 588)
java.lang.NullPointerException: Attempt to read from field 'de.amberhome.objects.appcompat.ACToolbarLightWrapper md.smfootball1a.main._actoolbarlight1' on a null object reference
at md.smfootball1a.main._activity_createmenu(main.java:588)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at md.smfootball1a.main._onCreateOptionsMenu(main.java:6710)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.runHook(BA.java:165)
at md.smfootball1a.main.onCreateOptionsMenu(main.java:136)
at android.app.Activity.onCreatePanelMenu(Activity.java:3324)
at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:362)
at android.support.v7.view.WindowCallbackWrapper.onCreatePanelMenu(WindowCallbackWrapper.java:98)
at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.onCreatePanelMenu(AppCompatDelegateImplBase.java:335)
at android.support.v7.view.WindowCallbackWrapper.onCreatePanelMenu(WindowCallbackWrapper.java:98)
at android.support.v7.app.ToolbarActionBar.populateOptionsMenu(ToolbarActionBar.java:454)
at android.support.v7.app.ToolbarActionBar$1.run(ToolbarActionBar.java:61)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1557)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
java.lang.NullPointerException: Attempt to read from field 'de.amberhome.objects.appcompat.ACToolbarLightWrapper md.smfootball1a.main._actoolbarlight1' on a null object reference
** Activity (main) Resume **
B4X:
Sub Activity_CreateMenu(Menu As ACMenu)
Menu.Clear
Try 'If the CommEngine Service has not been constructed yet, this routine will crash.
Select Case CommEngine.connected
Case True
Dim Item As ACMenuItem = ACToolBarLight1.Menu.Add2(0, 0, "mnuConnection", Null)
Item.ShowAsAction = Item.SHOW_AS_ACTION_ALWAYS
UpdateIcon("mnuConnection", LoadBitmap(File.DirAssets, "power-green.png"))
Case False
Dim Item As ACMenuItem = ACToolBarLight1.Menu.Add2(0, 0, "mnuConnection", Null)
Item.ShowAsAction = Item.SHOW_AS_ACTION_ALWAYS
UpdateIcon("mnuConnection", LoadBitmap(File.DirAssets, "power-red.png"))
End Select
Catch
Log("Cant read CommEngine variables")
Dim Item As ACMenuItem = ACToolBarLight1.Menu.Add2(0, 0, "mnuConnection", Null)
Item.ShowAsAction = Item.SHOW_AS_ACTION_ALWAYS
UpdateIcon("mnuConnection", LoadBitmap(File.DirAssets, "power-red.png"))
End Try
Dim Item As ACMenuItem = ACToolBarLight1.Menu.Add2(0, 0, "mnuClear", Null)
Item.ShowAsAction = Item.SHOW_AS_ACTION_ALWAYS
UpdateIcon("mnuClear", LoadBitmap(File.DirAssets, "trash.png"))
Dim Item As ACMenuItem = ACToolBarLight1.Menu.Add2(0, 0, "mnuSetClock", Null)
Item.ShowAsAction = Item.SHOW_AS_ACTION_ALWAYS
UpdateIcon("mnuSetClock", LoadBitmap(File.DirAssets, "stopwatch.png"))
Dim Item As ACMenuItem = ACToolBarLight1.Menu.Add2(0, 0, "mnuTimeOfDay", Null)
Item.ShowAsAction = Item.SHOW_AS_ACTION_ALWAYS
UpdateIcon("mnuTimeOfDay", LoadBitmap(File.DirAssets, "clock.png"))
End Sub
Any thoughts?
Last edited: