After 2 days of struggling with the new API 21 Toolbar and appCompat_v7, I think I found a bug on it. If you have 2 actions on your menu like this:
-
first of all use the app:showAsAction
instead of android:showAsAction
(like @ianhanniballake)
after that in onCreateActionMode
after Inflating your menu setShowAsAction
in code like this
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
mode.getMenuInflater().inflate(R.menu.your_menu_name, menu);
menu.findItem(R.id.your_first_menu_id).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
menu.findItem(R.id.your_second_menu_id).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
return true;
}
i had the same problem so after working on it these lines of code works fine for me.