Re: [android-developers] Can't grok Activity life cycle.

2010-06-08 Thread Leigh McRae
On 6/8/2010 10:48 AM, Sean Hodges wrote: On Tue, Jun 8, 2010 at 3:17 PM, Leigh McRae wrote: Well this really depends on the game. For smaller scale games the time to load from scratch is so short you might not realize that the game is actually being restarted. Some examples of

Re: [android-developers] Can't grok Activity life cycle.

2010-06-08 Thread Sean Hodges
On Tue, Jun 8, 2010 at 3:17 PM, Leigh McRae wrote: > >  Well this really depends on the game.  For smaller scale games the time to > load from scratch is so short you might not realize that the game is > actually being restarted. Some examples of the games I was referring to are "Armageddon Squad

Re: [android-developers] Can't grok Activity life cycle.

2010-06-08 Thread Leigh McRae
Well this really depends on the game. For smaller scale games the time to load from scratch is so short you might not realize that the game is actually being restarted. The framework is what it is and we can discuss this to the cows come home. The original point was knowing the order o

Re: [android-developers] Can't grok Activity life cycle.

2010-06-08 Thread Sean Hodges
There are a lot of large successful games available on Android, and they all appear to be using the activity lifecycle without much problem. I would start by taking a look at how they work. My experience is that a game might "pause" when I leave to answer a phone call or run another app. When I re

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Leigh McRae
The common case is where an activity is put into the background and isn't killed for memory. Forcing an Activity to save it's state when it's not required is a waste of resources on a resource scarce platform. On 6/7/2010 10:38 PM, Frank Weiss wrote: Hmm. I'm trying to grok how a world simu

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Frank Weiss
Hmm. I'm trying to grok how a world simulation that needs lots of memory is a common case instead of an extreme case for a handheld mobile device. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Leigh McRae
If you have a world simulation with lots of entities an what not it adds up. I just did some tests and onSaveInstanceState() always gets called when my activity is put into the background. This is an unnecessary burden to put on the app developer and will lead to many game developers to just

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Frank Weiss
I wonder what you mean by a fair amount of serialization. It would seem to me a kilobyte or so would suffice for most mobile applications. If it's much, much more than that, I think someone suggested using a caching strategy instead. I would suppose that means setting aside a few megs on the SD Car

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Leigh McRae
Got your reply late for some reason. I would agree with onSaveInstanceState being called whenever you are put into a killable state as it's the only thing that makes sense. As it turns out I am just about to do some tests with the logging you suggested. If this is the case it's a poor design

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Daniel M. Drummond
Perhaps testing your application, and outputting some info to the logs will help you resolve your misunderstanding, ie. put a line in onSaveInstanceState() to write a line to the logs such as "onSaveInstanceState() Called", and put a similar line in onPause(), onStop(), onDestroy(), etc. and then f

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Daniel M. Drummond
On Sun, 2010-06-06 at 18:18 -0700, Leigh McRae wrote: > I am having a really hard time grokking the Activity life cycle > concept. The main issue is with onStop() and onDestory() not being > guaranteed to be called before the process is killed. I though I had > it figured out when I saw that the

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Leigh McRae
First I would like to thank you for your hand holding. On 6/7/2010 10:45 AM, Mark Murphy wrote: Leigh McRae wrote: At this point as far as I can tell that onSaveInstance() must always be called before onStop() for this case (being put into the background) as I don't see how it can know wher

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Mark Murphy
Leigh McRae wrote: > At this point > as far as I can tell that onSaveInstance() must always be called before > onStop() for this case (being put into the background) as I don't see > how it can know where I am just popping up a quick options screen and > then back to my app or leaving the app in th

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Leigh McRae
On 6/7/2010 9:43 AM, Mark Murphy wrote: Leigh McRae wrote: So are you saying that onSaveInstanceState() is always called before the system needs to kill an activity? I am saying: 1. onSaveInstanceState() is always called before onStop(), as that is something both our docs references

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Mark Murphy
Leigh McRae wrote: > So are you saying that onSaveInstanceState() is always called before the > system needs to kill an activity? I am saying: 1. onSaveInstanceState() is always called before onStop(), as that is something both our docs references are in agreement upon 2. onStop() damn-near-alwa

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Leigh McRae
On 6/7/2010 6:50 AM, Mark Murphy wrote: Leigh McRae wrote: Looks like it says both :) Still whether it's before onPause() or onStop() doesn't matter much. "To capture that state before the activity is killed, you can implement an ||onSaveInstanceState()

Re: [android-developers] Can't grok Activity life cycle.

2010-06-07 Thread Mark Murphy
Leigh McRae wrote: > Looks like it says both :) Still whether it's before onPause() or > onStop() doesn't matter much. > > "To capture that state before the activity is killed, you can implement > an ||onSaveInstanceState() >

Re: [android-developers] Can't grok Activity life cycle.

2010-06-06 Thread Leigh McRae
Thank you for such a detailed reply! On 6/6/2010 9:34 PM, Mark Murphy wrote: Leigh McRae wrote: Thing is that the docs says onSaveInstanceState() will be called before onPause() No, it doesn't. In fact, it says just the opposite: "If called, this method will occur before onStop().

Re: [android-developers] Can't grok Activity life cycle.

2010-06-06 Thread Mark Murphy
Leigh McRae wrote: > Thing is > that the docs says onSaveInstanceState() will be called before > onPause() No, it doesn't. In fact, it says just the opposite: "If called, this method will occur before onStop(). There are no guarantees about whether it will occur before or after onPause()." http

[android-developers] Can't grok Activity life cycle.

2010-06-06 Thread Leigh McRae
I am having a really hard time grokking the Activity life cycle concept. The main issue is with onStop() and onDestory() not being guaranteed to be called before the process is killed. I though I had it figured out when I saw that the system calls onSaveInstanceState() when it's shutting down the