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

Can't solve: Switch to the strings.xml file and add a new String item named 'saveLabel' with the value "Save My Changes"

What I wrote down was: "string name="saveLabel">Save My Changes</string" as the answer but I can't pass the question. Am I wrong with the answer? Please help...

Shariq Shaikh
Shariq Shaikh
13,945 Points

Are there quotation marks the value?

I deleted the open tag and closing tag for string from the question. The hint I'm getting is "Bummer! Don't forget to add a 'name' attribute to your "string" element with the value "saveLabel".

3 Answers

Hi Ryan,

Well you are on the right path. However, if this is what you've written then it's incorrect
"string name="saveLabel">Save My Changes</string"

string is an element and will have its own tag. It does not come inside double quotes.

Just change that and you will get the following as given below.

Hope this helps

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <string name="saveLabel">Save My Changes</string>
</resources>
Daniel Hartin
Daniel Hartin
18,106 Points

Hi Ryan

It looks as if your not correctly using the <> tag brackets

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

You always need a < and > to define the opening and closing of each element. You use <string> to define the beginning of a string element and </string> to define the closing (the backslash simply denotes a closing bracket).

Hope this helps

Daniel

Hi Daniel Hi Gunjeet. Thank you all for your answers. The reason I didn't put open tag and closing tag was that if I put them in this comment it was hiding all the stuff inside. I wonder how you manage to write them into this comment. I managed to solve by opening new browser tab and typed them in and it passed. My apology to bring the confusion but thank you all. This is why I can't leave teamtreehouse. Thank you all for nice people here. :D

BTW please let me know how you manage to write open and closing tag in the comment.

It makes sense. You can use &lt; and &gt; to get < and > signs

Daniel Hartin
Daniel Hartin
18,106 Points

lol, I did the same thing my answer doesn't make any sense when I read it back.

If you put 3 backticks before your line of code treehouse will apply formatting instead of using the code. Look at the Markdown Cheatsheet link at the bottom of this page.

P.s I have edited my answer although it your problem is solved now.

Thanks Daniel