Hendra Anggrian Hendra Anggrian - 2 years ago 96
Android Question

what's wrong with hardcoded string in android xml file?

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.

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

thanks in advance.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download