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 trialprosper nyamukondiwa
656 Pointshelp please is this the answer
Inside the onCreate() method (after the setContentView() call), log the message "Activity created!" using the Log debug method (remember it's just one letter). The 1st parameter should be "TreehouseActivity", but use the TAG variable instead of typing it out a second time. The 2nd parameter is the message.
package com.teamtreehouse;
public class TreehouseActivity extends Activity {
public static final String TAG = "TreehouseActivity";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_treehouse);
Log.d(tag:"Activitycreated"; msg :"TreehouseActivity!;
}
}
1 Answer
Zach Freitag
20,341 PointsThere are a few issues with your log statement:
- "tag" should be "TAG"
- Remove the colon after "tag" - You must use a comma.
- Delete "Activitycreated" - I'm not sure how you came up with that, it has no business here.
- Delete "msg" - "msg" is just a nice UI feature within Android Studio, it does not compile with the code.
- Delete the colon after "msg" - We only use commas between the Log Method parentheses.
- Delete "TreehouseActivity!
- The challenge asks us not to repeat the value of the "TAG" variable listed above which is "TreehouseActivity"
- After TAG, you are asked to display the message they have listed.
Reading through these 8 key points you are left with this skeleton:
Log.d(TAG, "_______");
What message does the challenge ask you to display?
Zach Freitag
20,341 PointsZach Freitag
20,341 PointsI would love if you selected my response for best answer!