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 an Interactive Story App (Retired) User Input Introducing ImageViews

Having trouble with Signal from Mars project. Android studio says I need to @String resource

I was watching on how to make a story app and was doing great until I put in "android:contentDescription="Signals from Mars"/>" that i was told to due so in the video. The design screen on the sample phone went blank and was told that I should use a @String resource. I have no idea how to do this since I am still a rookie on making apps and the video have not has this problem. can someone please tell me How I can fix this issue?

2 Answers

Jonas Samulionis
Jonas Samulionis
6,874 Points

Hi,

You can actually extract String resource in common ways.

1# Try to hover the android:contentDescription="Signals from Mars" line. You should be able to se the Yellow info bulb on the left side. Click on it and extract the String resource. 2# Place the mouse cursor on "Signals from Mars" and hit "alt + enter", you should now be able to extract the String resource.

Basically the Android Studio creates the String of your contentDescription label. The same way as you can extract the String resources from TextView's, Button labels and so on.

These String resources are placed in your android project res folder. You can find it res/values/strings.xml

I hope it helps! :)

Regards, Jonas :)

Thanks you I think I got it working now. thanks for the advice.