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

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -