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 Self-Destructing Message Android App Sending Messages Creating the Message

Creating the Message

Hi. I can' figure out this code challenge from Creating the Message 3/3.

Here is my code below:

public void addNewEvent() { // param 1 = year, param 2 = month, param 3 = day Date date = new GregorianCalendar(2014, 0, 1).getTime();

    ParseObject calendar = new ParseObject("Event");
    calendar.put("eventName", "Birthday party");
    date.put("eventDate", );

}

It says that i must set the date of the event using the date variable, i got the key as "eventDate" so how should i set the date?

3 Answers

You're so close! The date variable is already set for you a few lines above. You just want to put it on the calendar by passing it in as the second parameter like so:

calendar.put("eventDate", date);

Thanks for your help Katie!. I solved it trying again a few times.

I couldn't get that line of code to work, but I tried

event.put("eventDate",date);

Hope this might help anyone else having trouble on this one.