[android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-23 Thread Indicator Veritatis
The only 'correction' needed, Roger, is that "backing out" is the wrong term. When Activity A 'calls' Activity B (really, sending an Intent), no "backing out" takes place. "Backing out" is a much more appropriate term for what happens when the user presses the Back key, which causes finish() to be

Re: [android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-23 Thread Dianne Hackborn
On Mon, Mar 14, 2011 at 3:25 PM, Indicator Veritatis wrote: > But (and you knew there was a 'but' coming), even this leaves > important questions unanswered. In particular, what does it mean to > "have input focus over any other activities"? You imply elsewhere that > it does NOT mean unconditiona

Re: [android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-22 Thread Mark Murphy
On Mon, Mar 21, 2011 at 10:59 PM, DulcetTone wrote: > My app responds to speech commands. > > I want the behavior to be that > > 1.  if back is hit on my initial activity, it exits. That is normal behavior. > 2.  My app has a few sub-activities it may launch on user speech- or > GUI input > 3.  

[android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-22 Thread harsh chandel
yes all things you specified could be done write overwrite back button code for 1 2 not clear 3 ok write overwrite onstop ,onpause,on resume On Mar 22, 7:59 am, DulcetTone wrote: > My app responds to speech commands. > > I want the behavior to be that > > 1.  if back is hit on my initial activity

[android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-21 Thread DulcetTone
My app responds to speech commands. I want the behavior to be that 1. if back is hit on my initial activity, it exits. 2. My app has a few sub-activities it may launch on user speech- or GUI input 3. if home is hit on ANY of my activities, I want all of them to finish. That's basically it. Wh

[android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-19 Thread Roger Podacter
No because I don't believe onDestroy would necessarily get called backing out of the activity. Only onPause would be guaranteed to be called. That activity's onDestrw would only get called at some random point in the future when the OS wants more memory. OnPause is the primary. At least that is my

[android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-19 Thread lbendlin
If one activity calls another, and when you then press "Back" from that activity, wouldn't the calling of onDestroy() assure you that the called activity is truly gone and the memory is freed? (Or conversely, if it isn't called, the activity may live on due to dangling references?) -- You rece

[android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-19 Thread BFL
that's beautiful, Diane! The matched-pair thing exactly what I was wanting to confirm - logcat messages are making a little more sense. Here's a summary as I understand it pulled from your interleaved response - let me know if I'm missing something. Matching pairs of events for an activity Any r

[android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-14 Thread Indicator Veritatis
Thanks, Dianne, for this very valuable supplement to the mysterious documentation on the Activity lifecycle! But (and you knew there was a 'but' coming), even this leaves important questions unanswered. In particular, what does it mean to "have input focus over any other activities"? You imply els

Re: [android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-13 Thread Kostya Vasilyev
13.03.2011 10:29, Indicator Veritatis пишет: > > I want to perform certain actions when the BACK or HOME keys are > > pressed, and ignore cases where a third-party activity simply pops up > > on part of the screen and then goes away. > > If you find yourself needing this, perhaps you need

Re: [android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-13 Thread Dianne Hackborn
2011/3/12 Indicator Veritatis > Actually, comparing with the text, I don't think it means "just what > is says". There is an asymmetry in the states, an asymmetry I believe > is deliberate, if poorly explained: that between onPause and onResume: > when you enter onPause, you may still be partiall

[android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-12 Thread Indicator Veritatis
As you say, onPause() and onResume() are by far the most commonly called. But if you run your app on a G1, and run it with other apps, you will see onStop() and onDestroy() called. You should also see onDestroy() called whenever the user presses the Back button, which calls finish(); but when f

[android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-12 Thread Indicator Veritatis
Interesting summary, but I don't think it addresses ALL the OP's legitimate concerns, hence my own questions/comments below: On Mar 12, 1:49 pm, Kostya Vasilyev wrote: > See below: > > 12.03.2011 23:55, DulcetTone пишет: > > > 1.  The phrasing on the legs into and out of onPause() are vague. > >

[android-developers] Re: Activity lifecycle... still a mystery to me

2011-03-12 Thread Roger Podacter
I recently wrote my first android app, and I too did not grasp the life cycle functions and they just didn't seem to work correctly, or the way I thought they should based on the graph. Here's my learned knowledge from writing my app. OnPause and onResume turned out to be by far and above the only