I'm trying to use CircleImageView as ActionBar icon (like chatting activity in WhatsApp). I've tried this approach:
CircleImageView actionBarIcon_Profile = new CircleImageView(this);
actionBarIcon_Profile.setImageDrawable(getResources().getDrawable(R.drawable.my_picture));
actionBarIcon_Profile.setLayoutParams(new LayoutParams(48, 48));
actionBarIcon_Profile.setId(R.id.actionBarIcon_Profile);
getActionBar().setIcon(R.id.actionBarIcon_Profile);
ids.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item type="id" name="actionBarIcon_Profile"/>
</resources>
It seems like ActionBar setIcon() only accepts drawables as input. I could have setup a circular shape xml and put it in my drawable folder, but even that I have to change the background of that xml file to fit my need. Any suggestions?