android - Performance: onCreateView vs dynamic loading -


i'm @ point right piece of ui layout based on conditions. layout made of 2 portions. upper half fine. lower half, however, debating between having fragment wrapper container, within view being set (setcontentview), single fragment responsible of loading correct lower half (oncreateview overriden).

for example, may have 3 different xml layout files accounting different ui looks, , @ run time fragment return right 1 based on conditions. or, not have 3 different xml layout files, , dynamically construct necessary widgets in same layout file (currently, maximum of 4 imagebuttons) @ runtime.

choice 1: 3 different xml files + 1 fragment load right 1 based on conditions.

choice 2: use current layout file, , populate lower half dynamically.

thanks in advance!

choice 1: 3 different xml files + 1 fragment load right 1 based on conditions.

choice 2: use current layout file, , populate lower half dynamically.

there isn't clear choice wrote. if intend change layouts between them @ runtime choose fragments(a fragment each of layouts, replace them more easily). if you'll choosing layout when layout first constructed make decision @ activity level , choose appropriate layout file.

or, not have 3 different xml layout files, , dynamically construct necessary widgets in same layout file (currently, maximum of 4 imagebuttons) @ runtime.

doesn't matter, not make real differences.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -