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 Weather App (2015) Hooking Up the Model to the View Plugging in the Data

Semen Zadorozhnyi
Semen Zadorozhnyi
8,515 Points

Brackets "trick" (good or bad?)

So.. in this lesson we using brackets trick to make double value String //mHumidityValue.setText(mCurrentWeather.getHumidity() + ""); In new Android Studio warning message appears:

  • Do not build messages by concatenating text chunks. Such messages can not be properly translated.

Q: Is it normal to use such transformation in TextView.setString() method (and others)?

1 Answer

J.D. Sandifer
J.D. Sandifer
18,813 Points

The error doesn't apply to what you're doing. It's saying that if you had something in the double quotes - like "% humidity" - then that text would always be in English; it couldn't be translated using the standard Android practice of string resource files for each language.

It's fine for what you're doing (no text - just an empty string). Check out Android string resources if you want more info.