Share information between Activities

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Share information between Activities

Postby turim » Fri Nov 25, 2011 5:46 pm

how best to share complex objects between Activities ?

When use Intent (putExtra), a new object is created.
The Google advises to uses 3 approaches:
- Singleton class
- A public static field/method
- A HashMap of WeakReferences to Objects

My application have many objects, and i need pass objects (in memory) between Activities.

How is the best approaches ?

Posts: 3
Joined: Mon May 02, 2011 2:10 pm


Re: Share information between Activities

Postby vandzi » Sat Dec 31, 2011 4:52 pm

I wrote blog post about this. It works for me. I hope it will be helpfull for you too
Junior Developer
Junior Developer
Posts: 20
Joined: Fri Jun 11, 2010 11:31 am
Location: Slovakia


Return to General

Who is online

Users browsing this forum: No registered users and 5 guests