Can't remove a view included using a include tag

Posted by Julio Rodrigues on Stack Overflow See other posts from Stack Overflow or by Julio Rodrigues
Published on 2014-08-22T16:16:13Z Indexed on 2014/08/22 16:20 UTC
Read the original article Hit count: 116

Filed under:

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?

© Stack Overflow or respective owner

Related posts about android