Android的:如何创建和QUOT;正在进行"通知?正在进行、通知、Android、QUOT

2023-09-12 07:05:19 作者:习惯就好。

您好,我如何创建永久性的通知,如第一个为电池指示?

Hello, How do i create the permanent notification like the first one for Battery Indicator?

推荐答案

指定 Notification.FLAG_ONGOING_EVENT 标记你的通知

样品code:

yourNotification.flags = Notification.FLAG_ONGOING_EVENT;
// Notify...

如果您不熟悉的通知 API,读的