Thanks TreKing for your approach, The only thing is I have to pass around an array of stuff, and the Intent interface only has:
Bundle getBundleExtra(String name) Intent putExtra(String name, Bundle value) Intent putExtras(Bundle extras) Intent replaceExtras(Bundle extras) I have started implementing the approach given by TreKing... The problem I am having is I need to pass an array of objects (all of the same type). If I am going to pass this array in a bundle I need to generate a key for each element in the array while adding them to the bundle. Is this the way to go (or is using a DB better)? Thanks, John Goche On Sep 27, 4:00 am, TreKing <[email protected]> wrote: > > On Mon, Sep 26, 2011 at 2:40 PM, John Goche < > [email protected]>wrote: > > > > > > public interface Bundleable > > { > > public Bundle toBundle(); > > > > public void fromBundle(Bundle b); > > > > } > > > > public class MyClass implements Bundleable > > { > > public Bundle toBundle() > > { > > Bundle b = new Bundle(); > > // Fill b with data > > return b; > > } > > > > public void from Bundle(Bundle b) > > { > > // set properties from data in b > > } > > > > } > > > > // ... > > > > MyClass m = new MyClass(); > > Intent i = new Intent(); > > i.putBundleExtra("MyClass", m.toBundle()); > > > > // ... Elsewhere > > > > Bundle b = intent.getBundleExtra("MyClass"); > > MyClass m = new MyClass(b); // Constructor calls > > fromBundle(b);<android-developers%[email protected]> > <http://groups.google.com/group/android-developers?hl=en> > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

