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 Lists and Adapters (2015) Using Parcelable Data Using a Creator and Reading a Parcel

Is there a limit to amount of information one should put in a bundle?

I've just been wondering if we need to worry about how much data we put into a bundle.

1 Answer

Hi John,

Yes, there is a limit. When transferring information between components using an Intent, bundles serialize the information into a binder transaction, which has a buffer limit of 1MB total (so multiple transactions can add up); you will throw a TransactionTooLargeException if you try to exceed this limit. You can get around this by saving the information and accessing it again, instead of using a bundle.

When saving the state of an activity, bundle size is just going to be limited by available memory.