Including Android Activities (and their layouts) in JAR files

前端 未结 1 1859
无人共我
无人共我 2021-02-06 14:45

I\'m trying to write a library that can be shared as a JAR file. This library will include an Activity and I\'d like to include the layout in the JAR. Since it doesn\'t seem pos

相关标签:
1条回答
  • 2021-02-06 15:17

    Native layout XML files are converted to a binary form, and include resource IDs baked at build time.

    However since all GUI elements can be instantiated at runtime, you could probably roll your own inflater with an XML parser and a bit of reflection.

    It may be easier in your case just to build the activity view programatically.

    0 讨论(0)
提交回复
热议问题