Skip to content

Instantly share code, notes, and snippets.

@ultimaters
Created March 28, 2015 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ultimaters/154250e7e6e82d14e11c to your computer and use it in GitHub Desktop.
Save ultimaters/154250e7e6e82d14e11c to your computer and use it in GitHub Desktop.
public void getOverflowMenu() {
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) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment