This may not be necessary. You will have onPause() called when the screen is turned off, which is the usual situation while the lock screen is up -- so you would only be unpaused when the screen is turned on with the lock screen, which is not that often. The behavior of going to sleep is slightly different in the emulator than the real device, which may be causing problems. This is something you might want to spend more time on when able to run on real hardware.
On Sep 8, 9:40 pm, Karl Rosaen <[EMAIL PROTECTED]> wrote: > Hi Joa, > > When the screen turns on, the lock screen is showing, which > technically is a system window, not an activity. This is why the > underlying activity is resumed. A better indication that your > activity is really in front of the user is to use: > > http://code.google.com/android/reference/android/app/Activity.html#on...) > > your activity will not get window focus until the lock screen is gone. > > Hope this helps, > Karl > > On Aug 31, 12:08 pm, Joa <[EMAIL PROTECTED]> wrote: > > > I am using Activity.onPause() and .onResume() to hibernate parts of my > > app's to save battery and stop "expensive" servercalls. It mostly > > works as expected, except for one situation involving the (newto > > me)blank/idlescreens. > > 1. When an app runs, and the (red) hangup-key is pushed, a screen > > blanks shows, and, as expected, .onPause() is called which allows to > > send an app into hibernation. > > 2. In this state, a push on any button changes from theblankscreen > > to an info screen (I haven't found how it's officially called) showing > > "Andrdoid", time, charge status etc. This screen does not show any > > parts of a running app, which is fine, except that app's > > receive .onResume(). Not quite as expected. Now, as a result of > > onResume(), "expensive" applicationcallsresume without any benefit > > to the user. > > Is this the desired behavior? If so, what is the correct practice to > > follow these state changes? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

