hi all

I have a very basic question regarding the lifetime of an instance
when it comes to the activity lifecycle changes.

Lets assume I have an activity that owns an instance of a (custom)
view class. This view instance has an instance x of another class X
(this class stores some application business data). What happens with
this instance x if onStop / onDestroy for the activity are called?
Will the instance be garbage collected and in turn will the
constructor for this instance be called once again when onRestart is
called?
Or will the instance completely remain in memory?

The Snake and LunarLander example store all the application's logical
data directly in the view classes and thus they can simply but the
basic values (integers etc) in a bundle. I've not seen an example
where you have a complexer class with data which you want to
save/recover and how one would do that respectively what you need to
do so that an instance of this complexer class is setup properly (so
that you dont get NullPointerException and all that nasty stuff ;-)).

looking forward to your answers and thanks for the patience with yet
another android newbie ;-)

greetings
dominique

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to