I’m trying to reference a formatted String in my strings.xml.
I was googling around and found this good article:
http://developer.android.com/guide/topics/resources/string-resource.html
I followed it to every detail it would seem, but the text printed out isn’t what it’s supposed to be.
First, in my strings.xml under resources, i defined it as:
<string name="print_binary">This is the printout: %1$s</string>
And in the .java i put:
String fromString = "one";
Resources res = getResources();
onScreen = String.format(res.getString(R.string.print_binary), fromString);
This gives the following text on screen:
This is the printout: %1$s
Please advice
Goodness, I’d totally missed inputting something like
And then adding an id for my TextView object.
Too late in the night. It seems like the String.format() statement isn’t necessary, i’ll read up on that.
Thanks for your support!