I'll assume you have a Vector<Foo>. 1. Make sure Foo implements Serializable or Parcelable. 2. Call toArray(Foo[]) on the Vector to get a Foo[]. 3. Set the Foo[] as an extra using Intent.putExtra(Serializable) or intent.putExtra(Parcelable[]). 4. In the resulting activity, get the array back using Intent.getSerializableExtra() or Intent.getParcelableArrayExtra(). 5. The former returns a Serializable which is actually an Object[]. The latter returns a Parcelable[]. Even though each element in the array is an instance of Foo, you can't cast either directly to Foo[]. 6. Create a new Vector<Foo> of the same size as your array. 7. Iterate over the array and add each element to the new vector, casting each to Foo.
Serialization can be expensive when the amount of data is large. So, if the vector or its elements are very large, store it somewhere global and hard-code the child activity to look in that global location. You'll probably want to erase this global reference (so the Vector can be garbage collected) when the calling activity is destroyed. This approach can also be problematic when it's possible for multiple instances of the child activity to exist on simultaneously on the stack. On Friday, September 21, 2012 7:51:53 AM UTC-5, rauf qureshi wrote: > > hello friends > I am trying to send Vector one activity to another activity how to do this > can any body tell me. > > > thanks > -- 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

