Can I use external XML files in for layouts in Android? -


this might silly question, generate layout xml file android on server, , when user presses button, xml file loaded android app.

is possible @ all?

i not think possible. layout inflator documentation here:

from documentation constructor:

public view inflate (xmlpullparser parser, viewgroup root) 

states:

important performance reasons, view inflation relies heavily on pre-processing of xml files done @ build time. therefore, not possible use layoutinflater xmlpullparser on plain xml file @ runtime.

why not create xml views , build them application? how android apps typically done. if want support totally dynamically generated screens going lot of work. developing own layout sytax, , creating view knows how dynamically render view syntax. need reinvent layout inflator thats built os.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -