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 an Interactive Story App (Retired) Intents and Multiple Activities Getting Data from an Intent

Don't we need to create the object first

In StoryActivity.java why we are using

Intent intent = getIntent();

and not

Intent intent = new Intent();

Intent intent = getIntent();

1 Answer

Hariidaran Tamilmaran
seal-mask
.a{fill-rule:evenodd;}techdegree
Hariidaran Tamilmaran
iOS Development Techdegree Student 19,305 Points

Actually, I'd like to point out in MainActivity.java, we already instantiated an Intent to send data to the StoryActivity class. So when you create a new Intent variable, and call getIntent(), it would receive the data required. So there is no need to instantiate a new Intent, as the work is already done.