[android-developers] Activity and Application life-cycle

2013-02-10 Thread dashman
I understand Activities can be paused and or destroyed when in the background or sleeping. If destroyed goes thru a full creation process agan. What happens to the Application object. Specifically - if the Activity is destroyed, is the Application object destroyed also. It seems like the

Re: [android-developers] Activity and Application life-cycle

2013-02-10 Thread Mark Murphy
On Sun, Feb 10, 2013 at 9:35 AM, dashman erjdri...@gmail.com wrote: I understand Activities can be paused and or destroyed when in the background or sleeping. Activities are paused when they move to the background. Activities are only called with onDestroy() when in the background as part of

Re: [android-developers] Activity and Application life-cycle

2013-02-10 Thread dashman
Making sure i understand this When an activity is asleep, it could be destroyed by the os. if destroyed, onDestroyed() will be called. if not destroyed, it'll be resumed. The reason i asked the original question was this. I have an Activity as well as an Application sub-class - i store some

Re: [android-developers] Activity and Application life-cycle

2013-02-10 Thread Mark Murphy
On Sun, Feb 10, 2013 at 10:26 AM, dashman erjdri...@gmail.com wrote: When an activity is asleep, it could be destroyed by the os. There is no concept of asleep. if destroyed, onDestroyed() will be called. Not necessarily. The process can be terminated without onDestroy() being called. if

Re: [android-developers] Activity and Application life-cycle

2013-02-10 Thread Kristopher Micinski
People overuse the Application class because of a poor understanding of what its lifecycle semantics are. To top that, they're not especially well explained in most documentation or books. But if you're storing things in the application class, you probably shouldn't be, why not store them in

Re: [android-developers] Activity and Application life-cycle

2013-02-10 Thread dashman
by activity asleep i really mean phone is asleep - as in not awake/screen off. yes eventually i think i will have to store the state data in storage. the problem is that i'm maintaining a linked list that changes often and did not want to take the hit of saving it constantly. -- -- You

Re: [android-developers] Activity and Application life-cycle

2013-02-10 Thread Kristopher Micinski
You should consider changing your data structure, but you should also know that the underlying persistence architecture already has efficiency in mind (wrt caching, etc...) The fact that you have to store this in the global application context is a sign of code smell. Why are you doing this?