Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Hein Zaw
2,402 PointsAll About @string Resources
Hi, I was stuck in below question, I believe my answer should hit the point, but it keep giving me an error message,
Question:
Now add a new String array to strings.xml named 'phoneNumbers'. Give it three items: "Home", "Work”" and "Mobile".
My answer:
<string-array name = "phoneNumbers">
<item>"Home"</item>
<item>"Work"</item>
<item>"Mobile"</item>
</string-array>
1 Answer
Ben Jakuben
Treehouse TeacherTwo things jump out:
There should be no spaces between name, the equals sign, and "phoneNumbers". I believe that is invalid XML, though I don't remember off the top of my head. :-/
The values of each item should not include quotes. Everything between the item tags is the value of the String. In this case, I guess the instructions are a little unclear: the values should not include the double quotes. (This is different than doing it in Java, obviously, where the double quotes make it a String.)
Hope this helps!