[android-beginners] Re: preventing Activity from destroying

2009-09-17 Thread cellurl
He might be using a cradle. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email

[android-beginners] Re: preventing Activity from destroying

2009-09-17 Thread Android Development
Just loved the title of the blog post. A very nice post. On Sat, Sep 12, 2009 at 3:11 AM, Mark Murphy wrote: > > Jason wrote: > > The service is picking up GPS locations; and sending to the server. > > Hence it needs to stay awake -- the server is tracking locations of the > > user on the web. >

[android-beginners] Re: preventing Activity from destroying

2009-09-11 Thread Mark Murphy
Jason wrote: > The service is picking up GPS locations; and sending to the server. > Hence it needs to stay awake -- the server is tracking locations of the > user on the web. Keeping the service alive all the time is very bad for the battery. I provide an analysis of this here: http://groups.go

[android-beginners] Re: preventing Activity from destroying

2009-09-11 Thread Jason
The service is picking up GPS locations; and sending to the server. Hence it needs to stay awake -- the server is tracking locations of the user on the web. On Fri, Sep 11, 2009 at 2:30 PM, Yusuf Saib (T-Mobile USA) < yusuf.s...@t-mobile.com> wrote: > > There are other ways to make a Service alwa

[android-beginners] Re: preventing Activity from destroying

2009-09-11 Thread Yusuf Saib (T-Mobile USA)
There are other ways to make a Service always work even if the phone sleeps; it depends on what your Service does. For example, if the Service's job is to respond to an Activity, then it is awake when the Activity is awake. Or if it responds to a broadcast Intent, ditto. Generally speaking, a Serv

[android-beginners] Re: preventing Activity from destroying

2009-09-10 Thread Jason
John Yes, you are right. Pressing Home does call just onStop; while pressing Back calls onDestroy. Btw, how do you ensure that the service keeps running and doing its job even when the phone goes to sleep (power save mode)? I added PowerManager = pm = (PowerManager) getSystemService(Context.POWE

[android-beginners] Re: preventing Activity from destroying

2009-09-09 Thread John P.
It is true that when the Back button is pressed, onDestroy() is called. But hitting the Home button invokes the activity's onStop() for me. Now, it is true that if Android determines it needs memory, it may then invoke onDestroy() on the stopped activity. It sounds like if you want your activit

[android-beginners] Re: preventing Activity from destroying

2009-09-09 Thread Mark Murphy
Jason wrote: > I have a UI > activity that gets destroyed each time I click the Home, phone etc. keys > on the phone. By default, Android will not destroy your activity when you "click the Home, phone etc. keys on the phone". There are only two ways I can think of for your described scenario to