Einsambr Einsambr - 1 year ago 65
Android Question

How do I delete an imageview so that it no longer exists?

For some certain reasons, I have created some

and assigned specific IDs to them (1, 2, 3, 4, ......). Now I want to COMPLETELY DESTROY those
so that I can assign the IDs (1, 2, 3, 4, ......) to other
. Can anyone tell me how to delete an
so that it no longer exists?

Thanks for your help!

Answer Source

You can use following code.

View image_view= view.findViewById(R.id.id_OF_IMAGEVIEW);
((ViewGroup) namebar.getParent()).removeView(image_view);

Hope this helps you..