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

Code Challenge from blog reader app.

Hi Ben,

<?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>

4 Answers

I tried it using IDE and it seems like it's working fine for me. But the tree house editor window is still showing me error. I am not able to figure it out. Help me out.

Challenge task 4 of 5 Now add a new String array to strings.xml named 'phoneNumbers'. Give it three items: "Home", "Work”" and "Mobile".

Syntax: <string-array name="...."> <item>...</item> <item>...</item> <item>...</item> </string-array>

<string-array name="phoneNumbers">
    <item>Home</item>
    <item>Work</item>
    <item>Mobile</item>
</string-array>

It should be like this.

Hasan,

Your "It should be like this" answer confused me (???) because I used it OUTSIDE (below) the Resource tags and it didn't pass.

So for clarification, this is the FULL strings.xml code:

<?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>