Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android

layout file

in the video at 3:41 to end say some call yellow warning errors can some tell what is this should i fix it and how to fix it?

string resouce?

Hi there,

Can you paste a link to the video please?

Thanks,

Steve.

4 Answers

Seth is correct - the warning is caused by you hard-coding a string rather than using the resource file; don't worry about it. You code will still work fine - just carry on through the course and it'll all get fixed at the right time. You'll come to that later on. :+1:

Steve.

Seth Kroger
Seth Kroger
56,407 Points

Sadly your question didn't get linked to the video you were mentioning. It sounds like you typed in the actual strings into the layout (hard-coding) instead of using a @string/identifier to point to a string resource. These are strings that are kept in the file strings.xml in the res/values folder. If you are just starting out on Android it isn't strictly necessary to fix it, but it is a best practice to use string resources. It keeps you string text in one place and allows you to substitute translations in other languages you have automatically based on the device's local language settings.

https://teamtreehouse.com/library/build-a-simple-android-app-2/creating-the-screen-layout/adding-a-button

why should i change refactor ? if i don change it app will not correctly ? or something else will happen?