private void getOverflowMenu() {
ViewConfiguration viewConfig = ViewConfiguration.get(this);
try {
Field overflowMenuField = ViewConfiguration.class
.getDeclaredField("sHasPermanentMenuKey");
if (null != overflowMenuField) {
overflowMenuField.setAccessible(true);
overflowMenuField.set(viewConfig, false);
}
} catch (NoSuchFieldException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
时间: 2024-10-05 06:29:18