android:text="Button"
doesn't work. I should make a special string for it in the values/strings.xml
and change the android:text="Button"
to android:text="@string/button"
for button having the value "Button"
.
What's the problem it used to work before?
Those are not error only warning, there is tool in every ide called lint which helps programmer to write code in standard format of that language. In android standard practice is to use string.xml for storing all of your string value that is used in xml, so lint shows a warning that you should not directly set label hard-coded rather add them in string resource then set the resource id.
And there is some advantage of using string values like
etc
You can find more information here --
hardcoded string "row three", should use @string resource
this answered my question, thank you, but if you have anything to add i'm glad to know it from you guys. Best.
Alan
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.