public static void forceMenuIcons(Menu menu){
  try {
    Class<?> MenuBuilder=menu.getClass();
    Method setOptionalIconsVisible=MenuBuilder.getDeclaredMethod("setOptionalIconsVisible",boolean.class);
    if (!setOptionalIconsVisible.isAccessible()) {
      setOptionalIconsVisible.setAccessible(true);
    }
    setOptionalIconsVisible.invoke(menu,true);
  }
 catch (  Exception ignored) {
  }
}

public static void forceMenuIcons ( Menu menu ) { try { Class < ? > MenuBuilder = menu . getClass ( ) ; Method setOptionalIconsVisible = MenuBuilder . getDeclaredMethod ( "setOptionalIconsVisible" , boolean . class ) ; if ( ! setOptionalIconsVisible . isAccessible ( ) ) { setOptionalIconsVisible . setAccessible ( true ) ; } setOptionalIconsVisible . invoke ( menu , true ) ; } catch ( Exception ignored ) { } }
set the menu to show menuitem icons in the overflow window .
