Skip to content

Instantly share code, notes, and snippets.

@skyisle
Created October 11, 2012 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save skyisle/3870191 to your computer and use it in GitHub Desktop.
Save skyisle/3870191 to your computer and use it in GitHub Desktop.
Force to use overflow menu
try {
// force to use overflow menu
ViewConfiguration config = ViewConfiguration.get(this);
Field menuKeyField = ViewConfiguration.class
.getDeclaredField("sHasPermanentMenuKey");
if (menuKeyField != null) {
menuKeyField.setAccessible(true);
menuKeyField.setBoolean(config, false);
}
} catch (Exception ex) {
// Ignore
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment