什么地方错了Android中的XML文件的硬盘codeD字符串? [英] what's wrong with hardcoded string in android xml file?

查看:192
本文介绍了什么地方错了Android中的XML文件的硬盘codeD字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢直接放简单的文本上的XML文件没有首先声明一个字符串。这是比较容易,更简单,少凌乱。然而,它总是有一个警告标志,每当我这样做。

I love to put simple text directly on the xml file without declaring a string first. It is easier, more simple and less messy. However, it always has a warning badge whenever I do so.

如果我在我的xml文件几十个硬codeD字符串没有关于警告?我会惹上麻烦?

What if I have a dozens of hardcoded string in my xml file without concerning the warning? Will I get into a trouble?

先谢谢了。

推荐答案

没有,你会不会惹上麻烦,但使用 @字符串/ yourString 在XML将成为一个好的做法和它会提高你的应用程序的性能。

No, you will not get into trouble, but using @string/yourString in your xml will be a good practice and it will improve your app performance.

这篇关于什么地方错了Android中的XML文件的硬盘codeD字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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