Why to use strings.xml?

后端 未结 3 910
滥情空心
滥情空心 2020-12-03 13:05

Could anyone please explain why having hard-coded strings is so bad? What issues should I expect if I hardcode strings? Why having a separate string xml file solves those is

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-03 13:53

    A string is a simple resource that is referenced using the value provided in the name attribute (not the name of the XML file). So, you can combine string resources with other simple resources in the one XML file, under one element.

提交回复
热议问题