在Android 2.2的(7级)功能 PowerManager.IsScreenOn()
返回一个布尔值,为真,如果屏幕打开和虚假如果屏幕关闭。我开发code为Android 1.5(3级)。我如何完成相同的任务在老版本的Android?
In Android 2.2 (Level 7) the function PowerManager.IsScreenOn()
returns a boolean that is true if the screen is turned on and false if the screen is turned off. I am developing code for Android 1.5 (Level 3). How do I accomplish the same task in older versions of Android?
我不想打开屏幕或关闭在我的code。我只是想知道它是什么。
I do not want to turn the screen on or off in my code. I just want to know what it is.
您可以通过设置的广播接收器的 ACTION_SCREEN_ON
和 ACTION_SCREEN_OFF
。
You can accomplish this by setting up broadcast receivers for ACTION_SCREEN_ON
and ACTION_SCREEN_OFF
.
上一篇:jQuery和touchstart,touchmove,touchendtouchstart、jQuery、touchend、touchmove
下一篇:如何设置MAXLINES一个TextView和ellipsize同时如何设置、MAXLINES、ellipsize、TextView