Remove an ImageView

2

Is there any way to remove an image in an ImageView or leave it empty via code?

For example: I "hedge"

img1.setImageResource(R.drawable.icon_circpreto);

How do you remove it via code?

    
asked by anonymous 31.10.2017 / 04:52

1 answer

2

You can do so

img1.setImageResource(android.R.color.transparent);

Another possible solution would be

img1.setImageDrawable(null);
    
31.10.2017 / 05:38