鸿蒙OS开发文档 鸿蒙OS NotificationConstant

2024-02-25 开发教程 鸿蒙OS开发文档 匿名 2

NotificationConstant

java.lang.Object
|---ohos.event.notification.NotificationConstant

public final class NotificationConstant
extends Object

提供静态常量来指示通知删除原因。

常量是调用 NotificationSubscriber#onCanceled(NotificationRequest, NotificationSortingMap, int) 时使用的 int 参数。

Since:

2

嵌套类摘要

修饰符和类型描述
static classNotificationConstant.DisturbMode枚举免打扰模式的类型。
static classNotificationConstant.InputEditType枚举在通知中提供给用户的选项的编辑类型。
static classNotificationConstant.InputsSource枚举用户输入源。
static classNotificationConstant.SemanticActionButton枚举触发 NotificationActionButton 时关联的 IntentAgent 将采取的操作。

字段摘要

修饰符和类型字段描述
static intAPP_CANCEL_ALL_REASON_DELETE表示由于应用程序取消了所有通知而删除了通知。
static intAPP_CANCEL_REASON_DELETE表示由于应用程序取消通知而删除通知。
static intAPP_CANCEL_REASON_OTHER表示通知因其他原因被删除。
static intCANCEL_ALL_REASON_DELETE表示由于用户清除所有通知而删除通知。
static intCANCEL_REASON_DELETE表示通知因用户清除而被删除。
static intCLICK_REASON_DELETE表示通知因为被点击而被删除。
static intERROR_REASON_DELETE指示由于 UI 错误而删除通知。
static StringEXTRA_INPUTS_SOURCE键表示输入源。
static intPACKAGE_BANNED_REASON_DELETE表示由于应用程序被禁止发送通知而删除通知。
static intPACKAGE_CHANGED_REASON_DELETE表示由于对应用程序进行了更改而删除了通知。
static intUSER_STOPPED_REASON_DELETE指示由于应用程序上下文已停止而删除通知。

方法总结

从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

字段详细信息

APP_CANCEL_ALL_REASON_DELETE

public static final int APP_CANCEL_ALL_REASON_DELETE

表示由于应用程序取消了所有通知而删除了通知。

APP_CANCEL_REASON_DELETE

public static final int APP_CANCEL_REASON_DELETE

表示由于应用程序取消通知而删除通知。

APP_CANCEL_REASON_OTHER

public static final int APP_CANCEL_REASON_OTHER

表示通知因其他原因被删除。

CANCEL_ALL_REASON_DELETE

public static final int CANCEL_ALL_REASON_DELETE

表示由于用户清除所有通知而删除通知。

CANCEL_REASON_DELETE

public static final int CANCEL_REASON_DELETE

表示通知因用户清除而被删除。

CLICK_REASON_DELETE

public static final int CLICK_REASON_DELETE

表示通知因为被点击而被删除。

ERROR_REASON_DELETE

public static final int ERROR_REASON_DELETE

指示由于 UI 错误而删除通知。

EXTRA_INPUTS_SOURCE

public static final String EXTRA_INPUTS_SOURCE

键表示输入源。

PACKAGE_BANNED_REASON_DELETE

public static final int PACKAGE_BANNED_REASON_DELETE

表示由于应用程序被禁止发送通知而删除通知。

PACKAGE_CHANGED_REASON_DELETE

public static final int PACKAGE_CHANGED_REASON_DELETE

表示由于对应用程序进行了更改而删除了通知。

USER_STOPPED_REASON_DELETE

public static final int USER_STOPPED_REASON_DELETE

指示由于应用程序上下文已停止而删除通知。