On Thu, Jul 15, 2010 at 8:41 PM, Bret Foreman <bret.fore...@gmail.com> wrote:
> Well, I implemented something as an experiment, using the PowerManager
> and acquiring a PARTIAL_WAKE_LOCK in the onStartCommand method of my
> service. I try to release the lock in the onDestroy method of the
> service but the wakelock object is null. Both the power manager object
> and the wakelock object are class variables of the service. And since
> I can't release the wakelock (because I've somehow lost the object) I
> get a "WakeLock finalized while still held" exception when the service
> is destroyed.
>
> This is the weirdest thing yet - an object just disappearing like
> that. Any ideas?

FWIW, take a look at my WakefulIntentService to see if it gives you any ideas:

http://github.com/commonsguy/cwac-wakeful

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to