public boolean _onCreateOptionsMenu(android.view.Menu menu) {
if (processBA.subExists("activity_createmenu")) {
processBA.raiseEvent2(null, true, "activity_createmenu", false, new de.amberhome.objects.appcompat.ACMenuWrapper(menu));
return true;
}
else
return false;
}
Not sure, but raiseEvent looks like asynchronous operation. So, when event happens "menu" (theoretically) can be absent.
Probably, better to use something like this:
This "suggestion" is ACTUALLY an option to solve the problem.
And another answer(Maybe not the best option), what I did it was just to enclose all the code with a TRY:
B4X:
Sub Activity_CreateMenu(Menu As ACMenu)
Try
'Your code to add items here
ToolBar.InitMenuListener
Catch
Log("Activity_CreateMenu Error")
End Try
End Sub