Can't remove a view included using a include tag
- by Julio Rodrigues
Removing a view that was included using a <include> tag seems to have no effect.
ViewGroup currentPersonContainer = (ViewGroup) root.findViewById(R.id.propria_pessoa_container);
if (dto.occupation!= null) {
.
.
.
} else {
root.removeView(currentPersonContainer);
}
After the root.removeView(currentPersonContainer); I can still find it in root and the view is still visible.
How can I remove a view included in a xml layout resource file?