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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -