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

Brecht Cantalice
Brecht Cantalice
781 Points

When using the getString method to reference the no_items string, I am unable to reference it.

Although the no_items string was created in strings.xml and referenced in activity_main_list.xml with no issues, when I try to reference it using getString in MainListActivity.java, no_items does not appear in the content assist after plugging in "R.string.", and even if I type it in manually, I receive an error saying no_items cannot be resolved or is not a field. And app_name, hello_world, and action_settings are available in the list.

Help would be appreciated!

1 Answer

Harry James
Harry James
14,780 Points

It may just be Eclipse is messing up. Try restarting it (File >> Restart).

If that doesn't fix the problem, take a look at your strings.xml file in XML View and check for errors (Is it spelt correctly, does it look right? etc...)

Brecht Cantalice
Brecht Cantalice
781 Points

This worked for me! Thanks!