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 trialRakeem Williamson
7,163 PointsCant figure out step 2 on this challenge
What am i doing wrong
import android.app.Activity;
import android.content.Intent;
public class CodeChallengeActivity extends Activity {
Intent intent = new Intent(this, CommentActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
// Some code has been omitted
public void addComment() {
}
}
1 Answer
Harry James
14,780 PointsHey Rakeem!
That's the right code! You've just written it in the wrong place!
Move all of the Intent code into the addComment() method and the challenge will pass :)
Hope it helps and happy coding ;)