How to create a layout file programmatically

I was wondering if it is possible to dynamically create an XML layout file that will be displayed to the user. The idea was to be able to retrieve a layout file from a central server that could display this dynamic, server-driven graphical interface.

+2
source share
2 answers

You will have a problem with how resource identifiers are pre-baked during build.

Since GUI elements can be created at run time, you can probably collapse your own inflatable element using an XML parser and a little reflection.

+1
source

XML layout files are packaged as binary, and inflation also comes from binary. I do not believe that arbitrary XML can be used for layout.

+2
source

All Articles