Could you please post the rest of your code - or at least the portion where you "call finish". I can't reproduce your problem with the information that is present.
Also, what version of the SDK are you using and where are you seeing this problem..on a device (which one) or the emulator (which platform) ? Thanks, Balwinder Kaur Mobile.Software.Development ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Oct 15, 2:51 am, Chris <themaninthesuitc...@googlemail.com> wrote: > I am using a PowerManager.WakeLock to lock to stop the screen auto > diming after a period of non use. This works fine up until I try to > release the lock. > > private void aquireBacklightLock() { > PowerManager pm = (PowerManager) getSystemService > (Context.POWER_SERVICE); > mWakeLock = pm.newWakeLock > (PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "mTag"); > mWakeLock.acquire(); > } > > private void releaseBacklightLock() { > if (mWakeLock != null) { > mWakeLock.release(); > } > } > > The aquireBacklightLock is called when the activity is created or > resumed. releaseBacklightLock is called in the onPause. However, if > I exit the app (I call finish) I get a force close a few seconds > later. The logcat is saying WakeLock finalized while still held. > > Where am I going wrong? --~--~---------~--~----~------------~-------~--~----~ 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 to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---