I go through this How to concatenate multiple strings in android XML? and in the end there are comments that
For clarity, Its works:
<string name="title">@string/app_name</string>.
– Andrzej Du?
I made my own example but it doesn't works. So does Andrzej wrong or I am doing something wrong in my code.
R.strings.bbb
should contains "bbb aaa"
but instead of "bbb aaa"
it contains "bbb @strings/aaa"
<string name="aaa">aaa</string>
<string name="bbb">bbb @strings/aaa</string>
Query:
Is it possible to do some concatenation only in xml, without source code changes?
Reason why I don't want to edit in code because I use this strings in xml/preferences.xml
For Example:
<ListPreference android:key="key_bbb" android:title="@string/bbb"
....
If you know what I mean, here there is no possibility to use something like this
String title = res.getString(R.string.title, appName);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…