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 Build a Blog Reader Android App Getting Data from the Web Parsing Data Returned in JSON Format

Hesham Alassaf
Hesham Alassaf
1,023 Points

A had a problem with log.i() method

The Challenge want me to put the title and the pages in the log but i tried every thing but i can't solve it !!

2 Answers

Hesham Alassaf
Hesham Alassaf
1,023 Points

The codes I wrote it is : Log.i("CodeChallenge", title + i + "," + pages); Log.i("CodeChallenge", title + "," + pages); Log.i("CodeChallenge", title, pages); Log.i("CodeChallenge", title + pages);

It must be like this (Ex. output: 'Book title 1, 300'.)

I faced some problem too when I started out on this challenge.

What it wants you to do is be exact with the syntax. The syntax demands you to print in the format

"Then use the 'Log.i()' method (with "CodeChallenge" as the tag) to write the book title, a comma, a space, and the number of pages"

So we have the title + ", " + pages

Remember to add space after the comma also there is no need to print the index number i since it is not asked for.

Hope that helps.

 Log.i("CodeChallenge", title + ", " + pages);