安卓:打开屏幕上,并通知用户通知、用户、屏幕上

2023-09-06 14:09:37 作者:瘾男

我有一些意向。当意图火灾,我想送一个弹出通知像AlertBox并打开屏幕上,让用户立即看到通知(我的意思是没有表现出锁屏)。

I have some Intent. When intent fires, I want to send a popup notification like an AlertBox and turn screen ON to let User see the notification immediately (I mean without showing a lockscreen).

如果你已经使用,例如,HandcentSMS那么你明白我的意思(如弹出式通知,当接受一个消息)

If you've used, for example, HandcentSMS then you understand what I mean (like a popup notification when accept a message)

如何组织的?任何code的例子吗?我有什么样的权限使用?

How to organize this? Any code examples? What kind of permissions I have to use?

感谢你在前进。

推荐答案

也许的 KeyguardLock 会做你想要的:弹出您的通知,然后调用 disableKeyguard ,然后重新启用,当用户完成后,或超时。

Perhaps KeyguardLock will do what you want: popup your notification and then call disableKeyguard, then re-enable when the user is done or after you time out.

安全 - 明智的它是一个有点冒险,但你去那里。

Security-wise it is a little risky, but there you go.