Skip to content Skip to sidebar Skip to footer

Actionbar Get Current Icon, Findviewbyid

I know how to set the icon of the actionbar, but how do I determine what icon is currently there? I don't see an accessor like getIcon , I think it is possible to find the icon vie

Solution 1:

According to the source code of ActionBarView.HomeView you should be able to get ImageView of icon by android.R.id.home.

So code may look like:

ImageViewimageView= (ImageView) findViewById(android.R.id.home);
Drawabledr= imageView.getDrawable();

Not sure if this will work with support libraries

Post a Comment for "Actionbar Get Current Icon, Findviewbyid"