D
Just tell me to always show up. ActionBar/Toolbar And don't hide in three points through the attribut. app:showAsAction value always i.e. replace current ifRoom|withText ♪app:showAsAction="always"
UPD_0:Also try to connect the support library and inherit the activities and fragments from the support library classes.OnCreateOptionsMenu method of fragmentation would have to be coded before the challenge. super And there's no need to inflate a new menu, but to add software new paragraphs in a set. Type menu.add(...)♪The absence of an icon in the menu is a baga that treats the addition of this code in activate://workaround from https://stackoverflow.com/a/30337653/3212712 to show menu icons
@Override
protected boolean onPrepareOptionsPanel(View view, Menu menu)
{
if (menu != null)
{
if (menu.getClass().getSimpleName().equals("MenuBuilder"))
{
try
{
Method m = menu.getClass().getDeclaredMethod("setOptionalIconsVisible", Boolean.TYPE);
m.setAccessible(true);
m.invoke(menu, true);
}
catch (Exception e)
{
Log.e(getClass().getSimpleName(), "onMenuOpened...unable to set icons for overflow menu", e);
}
}
}
return super.onPrepareOptionsPanel(view, menu);
}
UPD_1:According to the https://stackoverflow.com/a/11438245/3212712 to paint overflow The menu on the chassis with the cardboard button of the menu needs to be used with a dirty hak, because it doesn't correspond to the view of this nuance:Add it to this. onCreate Class Application♪ try {
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
}
This code is going to make a menu display in three points on the chassis with a cardboard menu button.