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 Exploring the Master-Detail Template Blog Reader Project Overview

Adam Jones
Adam Jones
3,196 Points

Blog Reader App Stage 1 Challenge Task 4 of 4

Hi guys,

Totally stumped by how I answer this one.

The question text is: Finally, write the 'message' variable to the log using the Log.d() method. For the first parameter of Log.d() (the tag), use “CodeChallenge”, and use the 'message' variable as the second parameter.

My code is:

String title1 = "Android is awesome";
String title2 = "Mike is cool";
String title3 = "Treehouse loves me";
/* Tried switching between different ways of declaring the array, but to no effect
String[] titles = {"Android is awesome","Mike is cool","Treehouse loves me"};
*/
String[] titles = {title1, title2, title3};
String message = titles[1];

Log.d(CodeChallenge, message);

However, it's getting rejected as the wrong answer, despite it being identical to this code which is supposedly the right answer.

The android documentation says I'm using the Log.d() function correctly and the Java documentation says I'm declaring and accessing the array properly.

What am I missing?

1 Answer

John Coffin
John Coffin
10,359 Points

What happens if you change the quotes from slanted to straight?

Log.d("CodeChallenge", message);