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 an Interactive Story App Intents and Multiple Activities Sending Data to a New Activity

Matthew Williams
Matthew Williams
3,103 Points

How exactly does intent extra work?

In Stage 3 video 4 (Working with Intent Extras) Ben passed data to another class using an intent. The only problem for me is that when he passes the intent it's a totally new variable. If that's the case how will the name be remembered if it's a new variable outside the scope (This question will require you to watch the video)?

I thought that working with extras was more out of that scene from Star Wars VI when Han Solo and the gang have a passcode to go Jakuu but it's an 'older clearance, so it checks out'. So will our intents inside a scope work like that or will it not be remembered when that data is passed?

When getting data that has been put in the intent Ben uses the name of the variable that was passed into the intent. I'm not sure where exactly you are referring to where he uses a different variable name but I see him using the very same variable name.