In Android programming, in Actionbar, three vertical dot menus will be displayed when there are too many entries, but during the actual machine testing, it is found that they do not display it. After searching for information and testing, the problem is found: If the machine has the menu key of the entity, the overflow menu will not be displayed on the right, but will be generated by pressing menu. This is not conducive to a unified interface style.
We can change the presence or absence of the system detects the entity menu key to change the display of this.
The menu display is judged based on the method public boolean hasPermanentMenuKey (). This method is to get the boolean value of sHasPermanentMenuKey.
The solution is as follows:
Add in onCreate():
try { ViewConfiguration mconfig = (this); Field menuKeyField = ("sHasPermanentMenuKey"); if(menuKeyField != null) { (true); (mconfig, false); } } catch (Exception ex) { }