0

i want to pass the Vector object into the

IntentObj.putExtra()

i have done like the below code

Intent confirmItemIntent = new Intent(this,
                    ItemConfirmSave.class);
            confirmItemIntent.putExtra("VECTORITEMCARDEDITTEXT", VECTORITEMCARDEDITTEXT);
            this.startActivity(confirmItemIntent);

is it correct ? if it is then how to get the passes Vector Object into next class i.e. ItemConfirmSave. Anyone please help.

Rob
  • 3,315
  • 1
  • 24
  • 35
i.n.e.f
  • 1,773
  • 13
  • 22

1 Answers1

0
// send where details is object
ClassName details = new ClassName();
Intent i = new Intent(context, EditActivity.class);
i.putExtra("Editing", details);
startActivity(i);


//receive
ClassName model = (ClassName) getIntent().getSerializableExtra("Editing");

And 

Class ClassName implements Serializable {
} 

Source How to send an object from one Android Activity to another using Intents?

Community
  • 1
  • 1
Damith
  • 1,982
  • 3
  • 28
  • 42
  • thnx for Reply Damith ,In my code VECTORITEMCARDEDITTEXT is an object of VectorItemCard which extends Vector & implements KvmSerializable, & according to your code i have written the below code VectorItemCard getvectVectorItemCardfromCreateItem =(VectorItemCard) getIntent().getSerializableExtra("VECTORITEMCARDEDITTEXT"); but it gives me exception AndroidRuntime(1673): java.lang.RuntimeException: Parcel: unable to marshal value com.Wsdl2Code.WebServices.ItemCard_Service.ItemCard – i.n.e.f Jan 28 '14 at 10:04
  • http://www.anddev.org/other-coding-problems-f5/starting-an-activity-passing-a-vector-object-to-it-t1033.html – Damith Jan 28 '14 at 10:23