开发者

override power button callback

Is it possible in an acitvity override the 开发者_开发百科callback called when the power button is pressed? My target is to prevent the screen off.

I found this - How to hook into the Power button in Android? -but it seems don't work.

THX


You can keep the screen on with a wake lock: http://developer.android.com/reference/android/os/PowerManager.html

But you should be carefull with it because it really drains the battery.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜