Links to internal strings

I wonder if it is possible to refer to the XML string value in another XML String resource.

The following options are possible:

<string name="title">MyTitle</string>
<string name="activityTitle">@string/title</string>

But in the case of a string with a matched resource, I haven't found a solution yet, so I'm looking for the following:

<string name="title">MyTitle</string>
<string name="subTitle">@string/title - mySubTitle</string>

So far, I could only solve this with:

<string name="title">MyTitle</string>
<string name="subTitle">%1$s - mySubTitle</string>
getResources().getString(R.string.subTitle, getResources().getString(R.string.title));

I would like to save string references in a string.xml file.

+5
source share
1 answer

You do not currently support AFAIK.

0
source

All Articles