Reputation: 189
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
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