Code example for Bitmap

Methods: copyisRecycled

0
    } 
 
    @Override 
    protected void dispatchDraw(final Canvas canvas) {
        if (isCacheEnabled) {
            if (cache == null || cache.isRecycled()) {
                updateCache(); 
            } 
            if (cache != null && !cache.isRecycled()) {
                canvas.drawBitmap(cache, null, new Rect(0, 0, getWidth(), getHeight()), paint);
            } 
        } else { 
            super.dispatchDraw(canvas);
        } 
    } 
 
    @Override 
    public void draw(final Canvas canvas) {
        if (!isCacheEnabled) {
            super.draw(canvas);
        }