开发者

Downloading an android layout from the internet

开发者 https://www.devze.com 2022-12-26 08:28 出处:网络
I would like ask if there\'s a way to download an android layout from the Internet into the \"res/layout\" folder.

I would like ask if there's a way to download an android layout from the Internet into the "res/layout" folder.

I was thinking in getting the file using an HttpUrlConnection and a FileOutputStream, like discussed in here Android download binary file probl开发者_如何学Cems but I can't fgure out how to put it into the "res/layout" folder.

Thanks!


Unfortunately the layouts in your 'res' directory are compressed at build time and include baked-in resource IDs that match your pre-built R.java. So it wouldn't be possible to take a new layout file at runtime and inflate it in the same way.

However layouts can be built up programatically (new Button() and so on), so you could probably make an XML format and reader that was quite similar to the standard layout format.

0

精彩评论

暂无评论...
验证码 换一张
取 消