Users Pricing

forum

Home Forums How to Pass object to another activity in android? – MindStick

How to Pass object to another activity in android?

Allen Scott 2507 19 Nov 2014

I have found this way to do this

Student student = new Student (18,"Zar E Ahmer");
Intent i = new Intent(this, B.class);
i.putExtra("studentObject", student);
startActivity(i);

The problem is that if the object changed in the first activity No change took place in the another activity. I thought how to make it like a constructor that no copy of the object is pass but the object it self.


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md