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
Post a Comment