How to set an empty drawable

Michael Nana picture Michael Nana · Aug 9, 2013 · Viewed 21.6k times · Source

I'm dealing with bugs in the Facebook SDK and so to remove the bugs I'll need to set a drawable to nothing not NULL just nothing or empty space or something. How can I do that programmatically?

Drawable=...

Answer

njzk2 picture njzk2 · Aug 9, 2013

You can use a transparent ColorDrawable:

Drawable transparentDrawable = new ColorDrawable(Color.TRANSPARENT);

That's a Drawable that represents the transparent color and doesn't have an intrinsic size.