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
Jack Hill
1,168 PointsPlease Help!
I am having a problem with this line of code. Eclipse is telling me that I should use the @string attibute when hard coding the TODO on the last line of this:
''' <ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitCenter" android:src="@drawable/ball01" android:contentDescription="TODO"/> '''
Eclipse wont let me run on my android phone til i fix this. this is in the activity_main.xml
Jack Hill
1,168 Points''' <ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitCenter" android:src="@drawable/ball01" android:contentDescription="TODO"/>'''
Jack Hill
1,168 Points''' <ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitCenter" android:src="@drawable/ball01" android:contentDescription="TODO"/> '''
Jack Hill
1,168 Points<ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitCenter" android:src="@drawable/ball01" android:contentDescription="TODO"/>
7 Answers
Gunjeet Hattar
14,483 PointsHello Jack
String files in Java are usually stored with @string attribute. Are you using the editor or the xml file.? If you are using the editor just double click on the text you want to change or use the property panel to the right when you select a element like textarea or something to change the text.
Not sure if I did answer your question. Could you paste here the part of the xml in your main_activity file that is giving the error. Will be easier to find out the issue.
Thanks
Jack Hill
1,168 Pointsmy code dosent want to paste down. I'm having trouble.
Jack Hill
1,168 Points''' Android <ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitCenter" android:src="@drawable/ball01" android:contentDescription="TODO"/> '''
James Anwyl
Full Stack JavaScript Techdegree Graduate 49,960 PointsHi Jack, You need to use 3 backticks (next to 1 on the keyboard) to get your code to show. Also add a blank line before and after the backticks.
Hope that helps!
Jack Hill
1,168 Points‘’’ <ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitCenter" android:src="@drawable/ball01" android:contentDescription="TODO"/> ‘’’
Jack Hill
1,168 PointsSome reason it seems that the forums don't like me pasting code. It shows the tic marks but thats it. I'll write the line of code out.
android:src="@drawable/ball01' android:contentDescription="TODO"/>
Jack Hill
1,168 PointsOh my gosh, Thank you James. This is what I get for staying up this late I was using the apostrophes.
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"
android:src="@drawable/ball01" android:contentDescription="TODO"/>
Jack Hill
1,168 PointsJack Hill
1,168 Points<ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitCenter" android:src="@drawable/ball01" android:contentDescription="TODO"/>