Skip to content Skip to sidebar Skip to footer

All Icons Of Actionmode Bar Are Not Showing In Android?

I have created a menu for my actionmode bar with icons but not all menu are showing with icon in actionmode bar. This is my menu xml file.

Solution 1:

This may be a little too late, but I'm putting this answer in case someone else runs into the same problem. It seems the system does not keep count of the app:showAsAction="always" attribute.

The soulution is to update the menus manually in onPrepareActionMode

@Override
        public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
            menu.findItem(R.id.menu_archive).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
            menu.findItem(R.id.menu_upload_to_cloud).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
            menu.findItem(R.id.menu_delete).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);

            return true;
}

This seems odd but it works.

Post a Comment for "All Icons Of Actionmode Bar Are Not Showing In Android?"