I have this xml
<ImageView
android:id="@+id/ImgOn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/icon_on" />
I want to remove this image sometimes via code. I've seen many posts like this,
but in my case imageButton.setBackgroundResource(0);
leaves the default image which appears in my xml layout.
How would you remove it programmatically? I heard transparent color crashes some old devices.
update
setImageResource(0) left the xml's original src as well and not null as i want it to be