android - How to detect whether screen is on or off if API level is 4? -


i wondering know how detect screen dim or brightness on android 1.6.

i've found solution on api level 7. easy develop :

powermanager pm = (powermanager) getsystemservice(context.power_service); boolean isscreenon = pm.isscreenon(); 

but need solution android 1.x.

can suggest me ?

thanks.

for screen on-off state, can try action_screen_on , action_screen_off intents, shown in blog post: http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -