I am using appcompat7 lib for backward compatibility ActionBar. Now I have a MenuItem that I am extracting, and then want to set ImageView myView as an icon.
How to do it from API level 11:
MenuItem menuItemRefresh = menu.findItem(R.id.refresh); menuItemRefresh.setActionView(myView);
For API levels below 11 this does not work, the second line will show an error. Is there any way to do this in compatibility mode?
Terry source share