Created
May 15, 2012 08:59
-
-
Save jfsurban/2700204 to your computer and use it in GitHub Desktop.
subclass of ImageView which nulls the drawable references and calls gc when the imageview is detached from the window - http://bit.ly/L5OWwu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SingleShotImageView extends ImageView { | |
public SingleShotImageView(Context context) { | |
super(context); | |
} | |
public SingleShotImageView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
public SingleShotImageView(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
} | |
@Override | |
protected void onDetachedFromWindow () { | |
setImageDrawable(null); | |
setBackgroundDrawable(null); | |
System.gc(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment