在一个Android字符串资源XML? [英] XML within an Android string resource?

查看:151
本文介绍了在一个Android字符串资源XML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在想,如果我可以放置在 /res/values​​/strings.xml XML?我问这个,因为我检查我的应用程序的XML数据文件,如果它还不存在那么它会包含一个字符串资源的默认内容创建它。

I was wondering if I could place XML within /res/values/strings.xml? I ask this because I am checking for the XML data file for my application, if it does not exist yet then it creates it from the default contents that will be contained as a string resource.

Eclipse中尝试使用GUI编辑字符串时不是比标签少和更大的改变其相应的HTML实体。 Eclipse是在正确的轨道?因为我认为它会被写入伸到我的文件作为HTML实体了。我可以用的getText(),而不是的getString()到实体转换回标签?

Eclipse tries to change the less than and greater than tags to their corresponding HTML entities when using the GUI to edit the strings. Is eclipse on the right track? Because I should think that it will be written out into my file as HTML entities too. Could I use getText() rather than getString() to convert the entities back into tags?

感谢您的任何建议可以给你。

Thanks for any advice you can give.

推荐答案

是的,你可以,只要使用CDATA

Yes you can, just use CDATA

<字符串名称=字符串名称><![CDATA [< HTML>喇嘛< / HTML>]]>< /串>

这篇关于在一个Android字符串资源XML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆