android - I don't quite understand the second and third parameters of inflater.inflate method -
this question has answer here:
can explain me container
, false
for? i'm kinda new android programming. need light!
view view = inflater.inflate(r.layout.top_section, container, false);
here description of function.
parameters
parser xml dom node containing description of view hierarchy.
root optional view parent of generated hierarchy (if attachtoroot true), or else object provides set of layoutparams values root of returned hierarchy (if attachtoroot false.)
attachtoroot whether inflated hierarchy should attached root parameter? if false, root used create correct subclass of layoutparams root view in xml.
to answer question, container used parent or root view of generated hierarchy. "false" flag tell inflater if inflated hierachy attached root parameter or container.
Comments
Post a Comment