I have created a class RoundIcon which extends View and the class contains setIconImage() method:
public void setIconImage(int imageFromResources) { icon
Definitely call invalidate instead of refreshDrawableState(). You might want to check what thread your on and if on a background call postInvalidate().