TakeKeyEvents not working effectively (no focus window error)
<p>My activity comes into play at screen off. I have logging for anytime it gains or lose focus. I have no indication that it has lost focus, however, I am seeing key events fall on the floor, and in the log the window manager reports- No focus window, dropping: KeyEvent (all the verbose details of what key it was).</p>

<p>This is only occasionally, so that is making it hard for me to pinpoint a cause. Because this is an event we expect to come in after an indefinite time asleep, I don't want to hold a partial wakelock. Most times everything works correctly.</p>

<p>Right after the failed key event, my activity does onResume and then the screen on broadcast comes in, and we are simply awake on the activity that's not normally supposed to be sitting on screen, because the key event fell on the floor.</p>

<p>I am trying to figure out why this happens even when at onCreate I use the TakeKeyEvents(true) which claims that it lets your activity get key events even when it is not the view with focus. I tried moving the command to onPause since issue seems to only appear when I am paused but I very quickly reduplicated the issue after trying that.</p>

<p>My source for this activity is here:
<a href="http://code.google.com/p/mylockforandroid/source/browse/trunk/myLock/src/i4nc4mp/myLock/Lockscreen.java" rel="nofollow">http://code.google.com/p/mylockforandroid/source/browse/trunk/myLock/src/i4nc4mp/myLock/Lockscreen.java</a></p>
