3
-
This does not work in android. You would have to load both strings at runtime and concatenate them.Karakuri– Karakuri2016-12-15 01:43:45 +00:00Commented Dec 15, 2016 at 1:43
-
stackoverflow.com/questions/3656371/…Randyka Yudhistira– Randyka Yudhistira2016-12-15 02:01:03 +00:00Commented Dec 15, 2016 at 2:01
-
the "c" value is used in AndroidMinifest.xmlfater zamoli– fater zamoli2016-12-15 02:44:49 +00:00Commented Dec 15, 2016 at 2:44
Add a comment
|
2 Answers
If you have these strings:
<string name="a">Hello</string>
<string name="b">World</string>
Then in your Activity you would do this:
String a = getString(R.string.a);
String b = getString(R.string.b);
String c = a + " " + b;
Alternatively, you can add a third string and retrieve it this way:
<string name="c">%s %s</string>
String c = getString(R.string.c, a, b);
