Re: [android-developers] How to handle OutofMemoryError in a service?

2010-08-10 Thread Kostya Vasilyev
Doug, You can set an alarm before allocating objects that result in the out of memory condition. But this is really just a band-aid - IMHO, you should optimize your service's memory usage. -- Kostya 10.08.2010 3:34, doug пишет: Hello, If my service encounters an OutofMemoryError when

[android-developers] How to handle OutofMemoryError in a service?

2010-08-09 Thread doug
Hello, If my service encounters an OutofMemoryError when creating new objects, what can I do to tell Android to restart my service later? I thought about Alarm but then I can't create a pending intent in the OutofMemoryError situation... Thanks, doug -- You received this message because you

Re: [android-developers] How to handle OutofMemoryError in a service?

2010-08-09 Thread Jenus Dong
Service is bound to acrtivity, this kind of service you can control. So if service has encounted an OutofMemoryError, the OS could restart your activity, you can restart your service in the activity, eg, OnCreate, OnRestart. On Tue, Aug 10, 2010 at 7:34 AM, doug doug_a...@yahoo.com wrote: