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 Android Fragments Ingredients and Directions The Directions Fragment

Is it necessary to initialize a new bundle for the directions fragment?

Can you just use the existing bundle and set it as the argument for the directionsFragment?

1 Answer

Jacob Bergdahl
Jacob Bergdahl
29,118 Points

Hi! I know it's been two months since you asked this question, but I figured I'd answer it in case anyone else was wondering the same thing.

Yes, you're right! At this point, you don't need to initialize a new bundle. In the video after this, however, Ben makes a refactoring where you need to use two bundles, or at least clear it first. In the second refactoring however, Ben removes that change, and brings it back to square one when it comes to the bundle's arguments. So yes, you're absolutely right, there is no need to re-initialize the Bundle :)

Ryan Dsouza
Ryan Dsouza
9,388 Points

Although it was 2 months late, thanks for posting. I had that exact same question