How can get a formatted string from res\values\strings.xml
in xml layout file?
Eg:
Have a res\values\strings.xml
like this:
<resources>
<string name="review_web_url"><a href="%1$s">Read online</a></string>
</resources>
and an xml layout file like this:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable name="model" type="com.example.model.MyModel" />
</data>
<TextView android:text="@string/review_web_url"/>
</layout>
How can I get the resource string review_web_url
passing/formatted with the value @{model.anchorHtml} ?
There is a way to get this formatted string like I do in java code:
String anchorString = activity.getString(R.string.review_web_url, model.getAnchorHtml());
but from xml layout?