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 trial

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.