Search code examples
androidbitmapiconsactionbarsherlock

Set a Bitmap as home icon in ActionBarSherlock


Is there a way to set a Bitmap (representing a contact photo retrieved from the address book) as the home icon in the ActionBarSherlock.


Solution

  • Given your Bitmap bmp just use a BitmapDrawable like this:

    Resources res = getResources();
    BitmapDrawable icon = new BitmapDrawable(res,bmp);
    getSupportActionBar().setIcon(icon);