I tried different combinations in xml file:
Adding to the answer from dev_ry, there is a much smoother way without using reflection by just casting and suppressing the restricted API warning:
import android.support.v7.view.menu.MenuBuilder;
@SuppressLint("RestrictedApi")
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (menu instanceof MenuBuilder) {
((MenuBuilder) menu).setOptionalIconsVisible(true);
}
getMenuInflater().inflate(R.menu.menu, menu);
return super.onCreateOptionsMenu(menu);
}