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().
Try calling View.invalidate() instead of View.refreshDrawableState()
Invalidate will tell the view that all of the pixels in the view need to be redrawn, if you are only updating a smaller area of the view look into the invalidate(Rect) overload for a performance boost.