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 challange - Blog Reader App - All about string resources

Update the 'phoneNumbers' variable to get its values from strings.xml instead of those already present in the code. First you need a Resources object using the 'getResources()' method and then call 'getStringArray()' from the 'resources' variable.

This is my code. What's it's wrong?

Resources resources = getResources(); phoneNumbers = resources.getStringArray(R.array.phoneNumbers);

thanks. Please help me.

2 Answers

Pardon me if I'm wrong, but I think it should look like this:

Resources resources = getResources(); 
phoneNumberLabels = resources.getStringArray(R.array.phoneNumbers);
Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

I had the wrong variable name in the instructions, but this has been fixed. So sorry for the confusion!