Einsambr
Einsambr

Reputation: 189

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

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

Thanks for your help!

Upvotes: 1

Views: 136

Answers (1)

skydroid
skydroid

Reputation: 733

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..

Upvotes: 1

Related Questions