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

Kevin Verbeek
Kevin Verbeek
5,499 Points

I made the key_name item in the strings.xml file manually, but android studio somehow didn't recognize it.

Strange thing, when I enter the string in the xml file manually, it doesn't recognize this in my main activity, but when I build resources by clicking alt enter on it and then naming is name as well, exactly the same resource is build, and then it is accepted.

Already fixed this myself, but I wonder why this is, shouldn't I be able to do it manually as well as letting it generate the resources for me or is this changed in v3 of android studio?

2 Answers

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

Hey Kevin! I'm not 100% sure, but you may need to build the project after making a change to a resource file.

Kevin Verbeek
Kevin Verbeek
5,499 Points

Hi Ben, thanks for your answer.

I found out this morning I was using String instead of string, which was the reason it didn't work.

Thanks for the intel thought!