1

I found this way at this link to force the actionbar overflow settings menu symbol (dashes) to be displayed:

  private void makeActionOverflowMenuShown() {
    //devices with hardware menu button (e.g. Samsung Note) don't show action overflow menu
    try {
      ViewConfiguration config = ViewConfiguration.get(this);
      Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
      if (menuKeyField != null) {
        menuKeyField.setAccessible(true);
        menuKeyField.setBoolean(config, false);
      }
    } catch (Exception e) {
      Log.w("Problem", "Making actionbar overflow");
    }
  }

This was criticized because of using reflection, saying that it makes the app fragile, since there's no guarantee of future inclusion of the declared field.

So I don't WANT to do it. I would only do so because the dashes don't show on a device I am testing (shown below).

Here's the screen I see without the hack--where is settings "dashes" icon in upper right corner?:

enter image description here

Ah, you say--it's the button at lower right of screen. But tapping it, here's what I see (not my menu):

enter image description here

So instead of using the hack, what should I do?

Or is the "hack" the way to do it?

Device is Samsung tablet SM-T217S, Android 4.2.2, software version T217SVPUAMH9.

* IMMEDIATE EDIT *

Oh. I found the "hardware" settings "button"--not on screen but on device bezel next to hardware home button.

I don't like that, since I'm not sure how many users do or don't know that's the button to show my app's settings (which it DOES).

So should I leave well enough alone and let the user figure out how to use his device, because pressing the hardware settings button does show my app's settings, or do should I use the hack above?

Community
  • 1
  • 1
DSlomer64
  • 4,234
  • 4
  • 53
  • 88
  • 1
    I would say just leave it alone! Most apps behave this way, where if there is a hardware menu button, there is no menu access in the ActionBar. The ActionBar is fairly new, and devices without hardware menu buttons are fairly new as well. So, users who have hardware menu buttons know that they're there, and know that this is the standard way to access settings. – Daniel Nugent May 20 '15 at 02:55
  • 1
    Thanks again, @DanielNugent. Will comply! – DSlomer64 May 20 '15 at 15:22

0 Answers0