1

I'm facing a strange issue that the overflow menu does not show up on a Samsung Galaxy S4 device. I'm using the default Android action bar (i.e., I add the commands directly to the form). I didn't explicitly define/change the commandBehavior theme constant.

Secondly, I noticed that the action bar color which I applied via colors.xml as explained here does not take effect (compare the attached 'expected' and actual' screenshots).

Any help will be appreciated.

Expected (Sony Xperia Z3):

expected

Actual (Samsung S4):

actual

Community
  • 1
  • 1

1 Answers1

2

Insert the following code in the beforeShowForm() method. It will add overflow menu and add your event in actionperformed method.

Toolbar toolbar = new Toolbar();
f.setToolbar(toolbar);
toolbar.addCommandToOverflowMenu(new Command("Test") {

  @Override
     public void actionPerformed(ActionEvent evt) {
         // its event
  }
});
Diamond
  • 7,428
  • 22
  • 37
tizbn
  • 1,907
  • 11
  • 16
  • I don't want to use the Toolbar API because the default look-and-feel isn't cool on Android (compared to the ActionBar) and I'm not willing to spend time styling to get the default look. Already talked with Shai about this elsewhere and he agrees that it's something to be improved. But back to my original question, the overflow menu should simply show on all Android devices where the ActionBar Android API is supported so I still think this is a bug. – netsuite_insights Feb 21 '16 at 18:47
  • I have not tested the colors.xml yet. I feel easy to use toolbar and update when you get its solution – tizbn Feb 22 '16 at 00:02
  • I agree that we need to improve the default look but I'd spend that time and go with the Toolbar API. Its a better direction. The native menu in a Samsung device is hidden within the menu button so you don't get the overflow menu. The `colors.xml` only works on newer versions of Android as far as I know (Lollipop onwards). – Shai Almog Feb 22 '16 at 04:11