Android的:如何创建和QUOT;正在进行"通知? [英] Android: How to create an "Ongoing" notification?

查看:153
本文介绍了Android的:如何创建和QUOT;正在进行"通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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,读的Creating状态栏通知在Android开发者网站。

If you aren't familiar with the Notification API, read Creating Status Bar Notifications on Android developers website.

这篇关于Android的:如何创建和QUOT;正在进行"通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆