Android Question AppCompat toolbar menu - "menu_close" event?

scsjc

Well-Known Member
Licensed User
Longtime User
See how onMenuOpened is handled in the inline java code: AppCompat with ToolBar - minimal example

It should be simple to add onPanelClosed based on that.

Im try but dont work, my java is very bad, can help me? thanks.

B4X:
#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;
  }
  else
  return false;
}
 
  @Override
  public void onPanelClosed(int featureId, android.view.Menu menu) {
        processBA.raiseEvent(null, "activity_menuclose");
  }
  public boolean onMenuOpened(int featureId, android.view.Menu menu) {
     if (menu != null) {
       processBA.raiseEvent(null, "activity_menuopen");
     }
  return super.onMenuOpened(featureId, menu);
  }
#End If
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
Looks correct. I guess that the Activity_MenuClose is not raised?

I have tried several ways, but it does not work.

Also with:
onContextMenuClosed (Menu menu)
onOptionsMenuClosed (Menu menu)
and it does not work
 
Upvote 0
Top