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!

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

Hello I am stuck on task 4 of 4 on the Java Review. Project Build a Blog Reader Android App. Can someone please help me.

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.

String title1 = "Android is awesome";

String title2 = "Mike is cool";

String title3 = "Treehouse loves me";

String [] titles = {title1, title2, title3};

String message = titles [1];

2 Answers

Stone Preston
Stone Preston
42,016 Points

you need to call the Log.d method and pass in some arguments to that function. a call to Log.d generally looks like this:

Log.d("flag", "some message");

you can use a variable as an argument like this:

Log.d("flag", someVariable);

the challenge tells you what the flag argument needs to be, and you need to use the message variable as the message argument.

Log.d("CodeChallenge", message);

Thankyou very much! You helped me understand very easily!