0

OK so I am passing a Serializable object from one activity to another like this:

Intent i = new Intent(GetVariants.this, RoadDetails.class);
i.putExtra("Variant", (Serializable)trips[0]);

and I receive the object on the other activity like this:

trip1 = (HashMap<String, Object>) intent.getSerializableExtra("Variant");
variant1 = new Variant();
variant1.Read(trip1);

So far so good things are working great but how can I send variant1 to another activity and how to receive it?

user3182266
  • 1,270
  • 4
  • 23
  • 49
  • `So far so good things are working great but how can I send variant1 to another activity and how to receive it?`. You did it in the first place. What's stopping you doing it again? – Blackbelt Mar 12 '14 at 14:50
  • you mean its the same? I do i.putExtra("Variant", (Serializable)variant1); and receive it with the same code? – user3182266 Mar 12 '14 at 14:53
  • yes of course. As long as Variant is `Serializable` (it meant that class implements the `Serializable` interface) – Blackbelt Mar 12 '14 at 14:54
  • yes the class "Variant" is Serializable but do I put intent.putExtra("Variant", (Serializable) trip1 or variant1? – user3182266 Mar 12 '14 at 14:57

0 Answers0