android - Java/XML: use a string in another string -
is possible utilize sting in string?
what want is:
<string name="homepage">http://www.examplepage.com</string> <string name="desc">go website: "string:"homepage"</string> so, if have more strings should show homepage, how deal if not want alter every singel string, "homepage" string?
you can this:
<string name="homepage">http://www.examplepage.com</string> <string name="desc">go website: %s</string> and in app have utilize string.format :
resources res = getresources(); string.format(res.getstring(r.string.desc), res.getstring(r.string.homepage)); java android xml string
No comments:
Post a Comment