I have a resource which is in an html format since i want to display it like that
<string name="calculator_bottom_sheet_body" translatable="false">
<![CDATA[<b>Basic requirements</b><br /><br />
You must be between 18 - 70 in order to proceed:
<ul>
<li> requirement 1</li>
<li> requirement 2</li>
<li> requirement 3 and</li>
<li> requirement 4</li>
</ul> <br /><br />
<b>Money requirement:</b><br /><br />
From €500 to €15.000<br /><br />
<b>Duration:</b><br /><br />
From 6 to 84 months<br /><br />
If you like to continue press the button below.]]>
</string>
and from the Fragment i retrieve the string like that
val body = resources.getString(R.string.calculator_bottom_sheet_body)
That works just fine. However i want the €500, €15.000 values to variables like €%s, €%s. So after i convert the line
From €%s to €%s<br /><br />
i need to call the resource from the fragment like
val body = resources.getString(R.string.calculator_bottom_sheet_body, minAmount, maxAmount)
And thats where i get this error
Wrong argument count, format string calculator_bottom_sheet_body requires 1 but format call supplies 2
Does anybody know whats the problem??
I think you need to update your string from
to
and use it like
Hope this helps.