I just need someone to tell me if I understood correctly when to use
and when
.
So, I make a header layout wh
Yes you understood it correctly. merge
is used as pseudo parent element to reduce the number of levels in view trees.
Just check this link, it gives very good explanation of merge
.
In your header file:
doesn't make any difference when your file is included in other file you mentioned. So it's a good thing to use merge
instead.
Since in XML you must use a single parent element and the rest of the XML elements should be included in it, you should use merge
as single parent element and can avoid adding unnecessary parent layout.
Just avoid 'merge' when you want to apply a layout differently than layout is defined in file in which your content is inclded.