android - do drawables need to be recycled? -
in activity have
final imageview img = (imageview) findviewbyid(r.id.myimage); img.setimagedrawable(getdrawable()); //getdrawable() own function returns drawable
then line
img.setimagedrawable(getdrawable()); //this line
is called many times replace drawable on current imageview.
will need recycle drawable or gc me? , if need recycle how do it?
drawables, else uses memory, marked garbage collection whenever there no longer references pointing them. if you're running situation memory isn't released drop reference previous drawable, well, that's garbagecollector you. gc try work in efficient way possible, means that, perspective, gets when gets it, , can't make go faster, if call object's dispose() method.
read guide explanation of what's going on under covers garbage collection.
Comments
Post a Comment