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

Android Build a Blog Reader Android App Rebuilding from Scratch All About @string Resources

Scott Graves
Scott Graves
2,255 Points

can't get past challenge task 4 of 5 in rebuilding from scratch/all about string resources

the challenge reads: Now add a new String array to strings.xml named 'phoneNumbers'. Give it three items: "Home", "Work”" and "Mobile".

so I have done the following in strings.xml:

<?xml version="1.0" encoding="utf-8"?> <resources> <string-array name="phoneNumbers"> <item>"Home"</item> <item>"Work"</item> <item>"Mobile"</item> </string-array>

<string name="saveLabel">Save My Changes</string>

</resources>

and I get this error: Bummer! Make sure to set the array values to exactly the values specified in the instructions.

I have tried various combinations but can not get past this challenge. I have even included the typo " in the Work item.

Any suggestions?

2 Answers

Hi

I'm not sure if your code is being displayed as you want in your question post ?

Have you defined it as a string-array? and added each item within item tags?

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="saveLabel">Save My Changes</string>
  <string-array name="phoneNumbers">
    <item>Home</item>
    <item>Work</item>
    <item>Mobile</item>
  </string-array>
</resources>

Regards Bob

Scott Graves
Scott Graves
2,255 Points

Thanks for your reply. Yes the fact that I posted xml simply clobber my response (silly me). I did see however that you had left the quotes out of your item listings and that was my error. I had included quotes and simply removing those solved the problem I was having. thanks again for replying.

Scott