how to write onFreeze() with nested objects?

Put your problem here if it does not fit any of the other categories.

how to write onFreeze() with nested objects?

Postby Anil » Fri Feb 08, 2008 5:22 pm

Does one have to save each individual primitive data member of every nested object?

For example one can have a member variable

Foo myFoo = new Foo();

if Foo has a reference to an instance of class Bar, we must save the individual primitive fields of Bar also?

If my understanding above is correct, this begs the question:
What if there is an array of Foo; each instance will contain a reference to a Bar.
We would have to explicitly set up an id in each Bar and each Foo, to link them.
This is tedious. I wish one could save only the top level reference.

thanks,
Anil
Anil
Developer
Developer
 
Posts: 44
Joined: Fri Jan 04, 2008 9:15 pm

Top

Postby Anil » Fri Feb 08, 2008 6:02 pm

I think I understand.
Every nested object must have an id to distinguish from other
instances,
and save(Bundle), restore(Bundle) methods.
thanks,
Anil
Anil
Developer
Developer
 
Posts: 44
Joined: Fri Jan 04, 2008 9:15 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 21 guests