Hey,
I am writing a small application that puts my phone (nexus one) to
sleep and on a particular key press wake up the phone and  forward me
to the default pattern lock screen. (writing this app since the power
button on my nexus one is not working)

Problem Faced:

I have a button in my activity that on click will set the
screenBrightness to 0.0. In my class i have also overridden the
onTouchEvent,dispatchTouchEvent,dispatchKeyEvent since I want to
capture a particular key press and then set the screenBrightness to
1.0 to wake up the phone. Ive also used flags

getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);

My broadcast receiver indicated to me that the screen has been
switched off when i click the above mentioned button. After this I
keep getting the exception

EXCEPTION :: No window to dispatch pointer action 0 and   No focus
window, dropping: KeyEvent{action=1...

Is there something I am missing here in order for the activity which
is set to FLAG_SHOW_WHEN_LOCKED  to listen to key events when the
phone is asleep. ?

Thanks




-- 
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

Reply via email to