I am trying to pass the object of a bean class to another activity.
i have to tried to send it with singleton class with a hash map of weak references for object.
- Code: Select all
WeakReference personal=new WeakReference(impl.getBean());
i will store this weakreference of object and key value in the singleton class with the static put method.
i also have the static get method for accessing the data back wherever i need.
Now my doubt is: is this a optimal solution?
I have also come across another way to do the same with putSerializable(),getSerializable() by making the bean class implementing Serializable interface.
is this correct way?
But this is not suggested in http://developer.android.com/guide/appe ... ework.html
(How do I pass data between Activities/Services within a single application?)
Why it is not specified there?
How to pass the hashmap of weakreferences to object between the activities.
i cant pass it.
will you provide the sample code for it.
i have referred the article posted in this forum.
HashMap meMap=new HashMap();
I have replaced the myStream with my object(bean class)
it is sent as serializable value.
while retrieving back am getting error.
How to retrieve the hashmap of weakreferences to object in another activity
but i can't do it.
I want to pass the data with out using serializable concept
Will you help to solve this problem