public
Last active

Force to use overflow menu

  • Download Gist
gistfile1.java
Java
1 2 3 4 5 6 7 8 9 10 11 12
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
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.