Android Question ACToolBarLight Creation in Class


Active Member
Licensed User
I am trying to move my ACToolBarLight stuff to a class, because I am implementing multiple Activities in a project.

Trying to add an icon to the ToolBar.

I need to do something like this from the Class module:
#If Java
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;
        return false;
#End If

Sub Activity_CreateMenu(Menu As ACMenu)
    '    Screenshot Icon
    shotBitMap = LoadBitmap(File.DirAssets,"monitor.png")
    ACShotItem = ACToolBarLight1.Menu.Add2(0,0,"shot",Null)
    ACShotItem.ShowAsAction = ACShotItem.SHOW_AS_ACTION_ALWAYS
    UpdateIcon("shot", AddBadgeToIcon(shotBitMap, 0))
But this will not compile, of course, since the Class module is not an Activity. I don't know very much about Java. Any ideas?