简体   繁体   English

如何在自定义锁定屏幕上获取通知

[英]How to get notification on custom lock screen

I have created a Lock screen and i want to show the notifications of messages,missed call etc on the lock screen for example if i received 2 messages and 3 missed calls then it should display on lock screen. 我已经创建了一个锁定屏幕,并且想要在锁定屏幕上显示消息通知,未接来电等通知,例如,如果我收到2条消息和3个未接来电,则它应该显示在锁定屏幕上。

Anyone please tell me how i can do this? 有人请告诉我我该怎么做?

you can use App Widgets which can also be displayed in the lock screens (maybe not all types). 您可以使用也可以在锁定屏幕中显示的App Widgets (可能不是所有类型)。
Consider the android:widgetCategory="home_screen|keyguard" property. 考虑android:widgetCategory="home_screen|keyguard"属性。

See these 看这些

App Widgets 应用小部件

you can make use of flag FLAG_SHOW_WHEN_LOCKED 您可以使用标志FLAG_SHOW_WHEN_LOCKED

and This great example by google. 很好的例子,由谷歌。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM