serialize your Object to bytes using protobuffer and include the bytes in the intent's extras.
On Fri, Oct 16, 2009 at 5:14 PM, Paul Turchenko <paul.turche...@gmail.com>wrote: > > Use Application class. > > On Oct 15, 10:44 pm, Sponge <simon.hei...@gmail.com> wrote: > > i think normaly by small objects to pass between activities ( like a > > string or an integer) i would also use the putExtras of the intent. > > But if you want to pass an own object of type ClassX i first tried to > > use the putExtras(Serializible myObject) and this works if you only > > want to display it, but if you want to change it in your data > > structure this doesn't work because it seems that there is a copy > > created of the object when it is passed in the intent, so if you > > change attributes of the object after passing it, there will be no > > change in your file structure. > > perhaps one solution would be to add an id to every object you create > > (like an integer) and pass this integer to get the object in the new > > activity or you realy make a static var where you store the object > > while passing it, but i dont realy like the static way. i use some > > activitys multiple times for diffenent objects to display so i cant > > just store everything in a static var because then it would be > > overwritten. > > > > On Oct 15, 8:50 pm, "Yusuf Saib (T-Mobile USA)" <yusuf.s...@t- > > > > Mobile.com> wrote: > > > Before you call startActivity with an Intent, first put extra into > > > into it with Intent.putExtras: > http://developer.android.com/reference/android/content/Intent.html#pu...) > > > > > Yusuf Saib > > > Android > > > ·T· · ·Mobile· stick together > > > The views, opinions and statements in this email are those of the > > > author solely in their individual capacity, and do not necessarily > > > represent those of T-Mobile USA, Inc. > > > > > On Oct 15, 5:51 am, Long <long...@gmail.com> wrote: > > > > > > Hi, > > > > There is an activity which has an object. This activity(say A) > > > > starts another activity(say B). > > > > Can B use some object in A? > > > > > > Cheers. > > > > Long > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---