private static void notifyDrawable(Drawable drawable, final boolean isDisplayed) {
        if (drawable instanceof RecyclingBitmapDrawable) {
            // The drawable is a CountingBitmapDrawable, so notify it
            ((RecyclingBitmapDrawable) drawable).setIsDisplayed(isDisplayed);
        } else if (drawable instanceof LayerDrawable) {
            // The drawable is a LayerDrawable, so recurse on each layer
            LayerDrawable layerDrawable = (LayerDrawable) drawable;
            for (int i = 0, z = layerDrawable.getNumberOfLayers(); i < z; i++) {
                notifyDrawable(layerDrawable.getDrawable(i), isDisplayed);
            }
        }
    }
private static void notifyDrawable(Drawable drawable, final boolean isDisplayed) {
        if (drawable instanceof RecyclingBitmapDrawable) {
            
            ((RecyclingBitmapDrawable) drawable).setIsDisplayed(isDisplayed);
        } else if (drawable instanceof LayerDrawable) {
            
            LayerDrawable layerDrawable = (LayerDrawable) drawable;
            for (int i = 0, z = layerDrawable.getNumberOfLayers(); i < z; i++) {
                notifyDrawable(layerDrawable.getDrawable(i), isDisplayed);
            }
        }
    }
private static void notifyDrawable ( Drawable drawable , final boolean isDisplayed ) { if ( drawable instanceof RecyclingBitmapDrawable ) { // The drawable is a CountingBitmapDrawable, so notify it ( ( RecyclingBitmapDrawable ) drawable ) . setIsDisplayed ( isDisplayed ) ; } else if ( drawable instanceof LayerDrawable ) { // The drawable is a LayerDrawable, so recurse on each layer LayerDrawable layerDrawable = ( LayerDrawable ) drawable ; for ( int i = 0 , z = layerDrawable . getNumberOfLayers ( ) ; i < z ; i ++ ) { notifyDrawable ( layerDrawable . getDrawable ( i ) , isDisplayed ) ; } } }
Notifies the drawable that it's displayed state has changed.

@param drawable
@param isDisplayed
Notifies the drawable that it s displayed state has changed .