I am doing similar stuff and I hold on to the Partial WakeLock inside the onCreate method and release it onDestroy. When I tried to hold the wakelock anywhere outside onCreate my service died out. Also I have made my servive a foreground service. Everything works fine now. Are you doing similar stuff?
The only problem I encounter now is that my app is having some conflict with google's car home app (GPS navigation). On Feb 18, 11:34 pm, Nick Owens <[email protected]> wrote: > For the experts listening... > > I have a background service running and I sometimes, but not always, > receive the following error when clicking on a notification, which > opens the main App activity. > > WakeLock finalized while still held > > In my search for an answer, I read the post below: > > http://www.mail-archive.com/[email protected]/msg160... > > While it appears to make sense technically, it doesn't work for this > app. Like scanning for voicemail, this background service needs to > constantly, and forever, stay alert - checking the server every few > minutes for notifications. > > So my questions are: > > 1.) Why is GC coming after my WakeLock (or is after my service?), just > b/c someone clicked on a notification it launched? > > 2.) Can I prevent GC from messing w/ my PowerManager object and my > service? > > 3.) is there a way to have the service running indefinitely w/ an > indefinite WakeLock? > > I understand the answer, if there is a sutiable one, probably doesn't > fit most apps out there. For that reason, it may not even make sense > to provide the answer, since every user from here on out will be able > to find it and leave their services running indefinitely. But I need > to, so please email me privately if you can. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

