Java android Multiple replacements specified in non-positional format; did you want to add the formatted = "false" attribute?

I want to disable the text in the TextView: this is my value in the line:

<string name="coords2">Lat: %1$.2f %c\nLon: %2$.2f\n(%3$.0fm)</string>

      

But when I create apk I see this:

Error:(764) Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
Error:(764) Unexpected end tag string

      

+3


source to share


1 answer


Hello you can print these characters using this



 TextView tvIn;
 String spcialCharacter="Lat: %1$.2f %c\\nLon: %2$.2f\\n(%3$.0fm)";
 tvIn=(TextView)findViewById(R.id.tvIn);
 tvIn.setText(Html.fromHtml(spcialCharacter));

      

+2


source







All Articles