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 trialahmed alghafli
3,446 PointsInside the onCreate() method (after the setContentView() call), log the message "Activity created!" using the Log debug
What should I do ??!!
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.tag,"Activity created");
Log.d(TAG,"Activity created");
}
}
``` Inside the onCreate() method (after the setContentView() call), log the message "Activity created!" using the Log debug method (remember that 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.
4 Answers
Sean M
7,344 PointsThe code challenges can be specific with the wording.
The final code is:
Log.d(TAG, "Activity created!");
AHMED ELBADWI
979 PointsYou just forgot to add the exclamation mark "!" .
Avraham Sedaghat
4,217 PointsIt seems that you have already added the Log debug statement with the correct tag and message. That's all you need to do. Please clarify your question if you still have a problem. Good luck.
mongst
10,841 PointsSpoiler Alert:
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,"Activity created!");
}
}
ahmed alghafli
3,446 Pointsahmed alghafli
3,446 PointsInside the onCreate() method (after the setContentView() call), log the message "Activity created!" using the Log debug method (remember that 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.