优惠码 第28页 NotificationRequest.NotificationMediaContent java.lang.Object |—ohos.event.notification.NotificationRequest.NotificationMediaContent public static final class NotificationRequest.NotificationMediaContent extends Object implements Sequenceable 构造一个可以与关联的音频会话交互的媒体播放通知。 在构造这个通知之前,你应该首先初始化一个 NotificationMediaContent 对象,并调用 setAVToken(ohos.media.common.sessioncore.AVToken) 为其附加一个 AVToken 以建立与关联的 AVSession 的交互通道。 您可以调用 [setShownActions(int]) 来请求在此通知中显示 NotificationActionButton 对象。 然后,您应该初始化一个 NotificationRequest 对象并调用 NotificationRequest#setContent(NotificationContent) 将其设置为媒体播放通知,并将先前构造的 NotificationMediaContent 对象附加到它。 此外,您应该调用 NotificationRequest#addActionButton(NotificationActionButton) 以便媒体控制按钮在此通知发布后显示在此通知中。 Since: 3 嵌套类摘要 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 构造函数摘要 构造函数 描述 NotificationMediaContent() 用于创建 NotificationMediaContent 实例的默认构造函数。 方法总结 修饰符和类型 方法 描述 String getAdditionalText() 通过为此媒体播放通知调用 setAdditionalText(java.lang.String) 获取已设置的附加文本。 AVToken getAVToken() 获取附加到此媒体播放通知的 AVToken。 int[] getShownActions() 获取表示要在此媒体播放通知中显示的 NotificationActionButton 对象的序列号列表。 String getText() 获取本次媒体播放通知调用 setText(java.lang.String) 设置的通知内容。 String getTitle() 获取通过调用 setTitle(java.lang.String) 为该媒体播放通知设置的标题。 boolean marshalling(Parcel out) 将此 Notification Media Content 对象编组为 Parcel。 NotificationRequest.NotificationMediaContent setAdditionalText(String additionalText) 设置要包含在此媒体播放通知中的附加文本。 NotificationRequest.NotificationMediaContent setAVToken(AVToken avToken) 将指定的 AVToken 附加到此媒体播放通知。 NotificationRequest.NotificationMediaContent setShownActions(int[] actions) 设置最多三个 NotificationActionButton 对象以显示在此媒体播放通知中。 NotificationRequest.NotificationMediaContent setText(String text) 设置要包含在此媒体播放通知中的文本。 NotificationRequest.NotificationMediaContent setTitle(String title) 设置此媒体播放通知的标题。 String toString() 返回对象的字符串表示形式。 boolean unmarshalling(Parcel in) 从 Parcel 中解组此 NotificationMediaContent 对象。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor 构造函数详细信息 NotificationMediaContent public NotificationMediaContent() 用于创建 NotificationMediaContent 实例的默认构造函数。 Since: 3 方法详情 getTitle public String getTitle() 获取通过调用 setTitle(java.lang.String) 为该媒体播放通知设置的标题。 返回: 返回此通知的标题。 Since:...
2024-04-03
NotificationRequest.NotificationLongTextContent java.lang.Object |—ohos.event.notification.NotificationRequest.NotificationLongTextContent public static final class NotificationRequest.NotificationLongTextContent extends Object implements Sequenceable 构造包含长文本的通知。 长文本最多包含 1024 个字符。 此类与 NotificationContent 和 NotificationRequest 一起使用。 示例代码: NotificationRequest request = new NotificationRequest(); NotificationLongTextContent longTextContent = new NotificationLongTextContent(); NotificationContent notificationContent = new NotificationContent(longTextContent); request.setContent(notificationContent); Since: 1 嵌套类摘要 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 构造函数摘要 构造函数 描述 NotificationLongTextContent() 用于创建空 NotificationLongTextContent 实例的默认构造函数。 NotificationLongTextContent(String longText) 用于创建 NotificationLongTextContent 实例的构造函数,传入参数 longText 已传递。 方法总结 修饰符和类型 方法 描述 String getAdditionalText() 获取调用 setAdditionalText(java.lang.String) 方法指定的长文本通知的附加文本。 String getBriefText() 获取调用setBriefText(java.lang.String)方法指定的长文本通知的简短文本。 String getExpandedTitle() 获取此长文本通知展开时将显示的标题。 String getLongText() 获取通知的长文本,通过调用 setLongText(java.lang.String) 方法设置。 String getText() 获取调用setText(java.lang.String)方法指定的长文本通知的内容。 String getTitle() 获取调用 setTitle(java.lang.String) 方法指定的长文本通知的标题。 boolean marshalling(Parcel out) 将 NotificationLongTextContent 对象编组到 Parcel。 NotificationRequest.NotificationLongTextContent setAdditionalText(String additionalText) 设置要包含在长文本通知中的附加文本。 NotificationRequest.NotificationLongTextContent setBriefText(String briefText) 设置要包含在长文本通知中的简短文本。 NotificationRequest.NotificationLongTextContent setExpandedTitle(String expandedTitle) 设置展开此长文本通知时显示的标题。 NotificationRequest.NotificationLongTextContent setLongText(String longText) 设置要包含在长文本通知中的长文本。 NotificationRequest.NotificationLongTextContent setText(String text) 设置要包含在长文本通知中的内容。 NotificationRequest.NotificationLongTextContent setTitle(String title) 设置长文本通知的标题。 String toString() 返回对象的字符串表示形式。 boolean unmarshalling(Parcel in) 从 Parcel 中解组 NotificationLongTextContent 对象。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor 构造函数详细信息 NotificationLongTextContent public NotificationLongTextContent() 用于创建空 NotificationLongTextContent 实例的默认构造函数。 Since: 1 NotificationLongTextContent public...
2024-04-03
NotificationRequest.NotificationConversationalContent.ConversationalMessage java.lang.Object |—ohos.event.notification.NotificationRequest.NotificationConversationalContent.ConversationalMessage public static final class NotificationRequest.NotificationConversationalContent.ConversationalMessage extends Object implements Sequenceable 提供用于定义在使用 NotificationConversationalContent 创建的通知中使用的会话消息的方法。 每条消息都包含消息内容、时间戳和发送者; 消息内容和发件人信息将显示在通知栏中。 Since: 3 嵌套类摘要 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static Sequenceable.ProducerNotificationRequest.NotificationConversationalContent.ConversationalMessage PRODUCER 从 Parcel 创建一个 ConversationalMessage 实例。 构造函数摘要 构造函数 描述 ConversationalMessage(String text, long timestamp, MessageUser sender) 用于创建带有文本、时间戳和 MessageUser 初始化的 ConversationalMessage 实例的构造函数。 方法总结 修饰符和类型 方法 描述 long getArrivedTime() 获取此消息到达的时间。 String getMimeType() 获取此消息的 MIME 类型。 MessageUser getSender() 获取此消息的发送者。 String getText() 获取要显示为该消息内容的文本。 Uri getUri() 获取具有特定 MIME 类型的消息内容的 URI。 boolean marshalling(Parcel out) 将此 Conversation Message 对象编组为 Parcel。 NotificationRequest.NotificationConversationalContent.ConversationalMessage setData(String mimeType, Uri uri) 设置此消息的 MIME 类型和 URI。 String toString() 返回对象的字符串表示形式。 boolean unmarshalling(Parcel in) 从 Parcel 中解组此 ConversationalMessage 对象。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor 字段详细信息 PRODUCER public static final Sequenceable.ProducerNotificationRequest.NotificationConversationalContent.ConversationalMessage PRODUCER 从 Parcel 创建一个 ConversationalMessage 实例。 Since: 4 构造函数详细信息 ConversationalMessage public ConversationalMessage(String text, long timestamp, MessageUser sender) throws IllegalArgumentException 用于创建带有文本、时间戳和 MessageUser 初始化的 ConversationalMessage 实例的构造函数。 参数: 参数名称 参数描述 text 指示要作为消息内容显示的文本。 此参数不能为空。 timestamp 指示消息到达的时间。 sender 指示发送消息的 MessageUser。 Throws: Throw名称 Throw描述 IllegalArgumentException 如果 text 为 null,则引发此异常。 Since:...
2024-04-03
NotificationRequest.NotificationConversationalContent java.lang.Object |—ohos.event.notification.NotificationRequest.NotificationConversationalContent public static final class NotificationRequest.NotificationConversationalContent extends Object implements Sequenceable 构造一个类似对话的通知,其中包括多个用户之间的消息通信。 构造类会话通知时,需要调用 NotificationRequest#setContent(NotificationContent) 设置对应的通知内容类型。 您可以调用 setConversationTitle(java.lang.String) 来设置对话的标题,并调用 addConversationalMessage(ohos.event.notification.NotificationRequest.NotificationConversationalContent.ConversationalMessage) 来添加包含在对话中的消息。 使用这两种方法设置的标题和消息会影响分别调用 setTitle(java.lang.String) 和 setText(java.lang.String) 设置的标题和文本的显示效果。 Since: 3 嵌套类摘要 修饰符和类型 类 描述 static class NotificationRequest.NotificationConversationalContent.ConversationalMessage 提供用于定义在使用 NotificationConversationalContent 创建的通知中使用的会话消息的方法。 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 构造函数摘要 构造函数 描述 NotificationConversationalContent(MessageUser user) 用于创建具有指定 MessageUser 的 NotificationConversationalContent 实例的构造函数。 方法总结 修饰符和类型 方法 描述 NotificationRequest.NotificationConversationalContent addConversationalMessage(String text, long timestamp, MessageUser sender) 根据指定的消息内容、时间戳和 MessageUser 向此类似对话的通知添加消息。 NotificationRequest.NotificationConversationalContent addConversationalMessage(NotificationRequest.NotificationConversationalContent.ConversationalMessage message) 将指定消息添加到此类似对话的通知中。 String getAdditionalText() 获取已通过调用 setAdditionalText(java.lang.String) 为这个类似对话的通知设置的附加文本。 ListNotificationRequest.NotificationConversationalContent.ConversationalMessage getAllConversationalMessages() 获取包含在此类似对话的通知中的所有消息。 String getConversationTitle() 获取要为对话显示的标题。 MessageUser getMessageUser() 获取用户在此类似对话的通知中发送的任何消息要显示的消息发件人。 String getText() 获取该类会话通知调用 setText(java.lang.String) 设置的通知内容。 String getTitle() 获取通过调用 setTitle(java.lang.String) 为这个类似对话的通知设置的标题。 boolean isConversationGroup() 检查此通知是否代表群组对话。 boolean marshalling(Parcel out) 将此通知对话内容对象编组到包裹中。 NotificationRequest.NotificationConversationalContent setAdditionalText(String additionalText) 设置要包含在此类似对话的通知中的附加文本。 NotificationRequest.NotificationConversationalContent setConversationGroup(boolean conversationGroup) 设置此通知是否代表群组对话。 NotificationRequest.NotificationConversationalContent setConversationTitle(String conversationTitle) 设置要为对话显示的标题。 NotificationRequest.NotificationConversationalContent setText(String text) 设置要包含在此类似对话的通知中的文本。 NotificationRequest.NotificationConversationalContent setTitle(String title) 设置此对话式通知的标题。 String toString() 返回对象的字符串表示形式。 boolean unmarshalling(Parcel in) 从 Parcel 中解组此 NotificationConversationalContent 对象。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor 构造函数详细信息 NotificationConversationalContent public NotificationConversationalContent(MessageUser user) throws IllegalArgumentException 用于创建具有指定 MessageUser 的 NotificationConversationalContent 实例的构造函数。 参数:...
2024-04-03
NotificationRequest.NotificationContent java.lang.Object |—ohos.event.notification.NotificationRequest.NotificationContent public static final class NotificationRequest.NotificationContent extends Object implements Sequenceable 设置要传递给 NotificationRequest#setContent(NotificationRequest.NotificationContent) 方法的通知内容。 内容类型可以是 NotificationRequest.NotificationNormalContent、NotificationRequest.NotificationLongTextContent 或 NotificationRequest.NotificationPictureContent。 您可以使用此类的构造函数来指定要使用的类型。 Since: 1 嵌套类摘要 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static int NOTIFICATION_CONTENT_BASIC_TEXT 表示基本通知。 static int NOTIFICATION_CONTENT_CONVERSATION 表示包含多个用户之间对话的通知。 static int NOTIFICATION_CONTENT_LONG_TEXT 表示包含长文本的通知。 static int NOTIFICATION_CONTENT_MEDIA 表示包含媒体播放会话的通知。 static int NOTIFICATION_CONTENT_MULTILINE 表示包含多行独立文本的通知。 static int NOTIFICATION_CONTENT_PICTURE 表示包含图片的通知。 static Sequenceable.ProducerNotificationRequest.NotificationContent PRODUCER 从 Parcel 创建 NotificationContent 实例。 构造函数摘要 构造函数 描述 NotificationContent(NotificationRequest.NotificationConversationalContent conversationContent) 用于创建 NotificationRequest.NotificationConversationalContent 实例(通过调用 getNotificationContent() 获得)并将内容类型设置为 NOTIFICATION_CONTENT_CONVERSATION(通过调用 getContentType() 获得)的构造函数。 NotificationContent(NotificationRequest.NotificationLongTextContent longTextContent) 用于创建 NotificationRequest.NotificationLongTextContent 实例(通过调用 getNotificationContent() 获得)并将内容类型设置为 NOTIFICATION_CONTENT_LONG_TEXT(通过调用 getContentType() 获得)的构造函数。 NotificationContent(NotificationRequest.NotificationMediaContent mediaContent) 用于创建 NotificationRequest.NotificationMediaContent 实例(通过调用 getNotificationContent() 获得)并将内容类型设置为 NOTIFICATION_CONTENT_MEDIA(通过调用 getContentType() 获得)的构造函数。 NotificationContent(NotificationRequest.NotificationMultiLineContent multiLineContent) 用于创建 NotificationRequest.NotificationMultiLineContent 实例(通过调用 getNotificationContent() 获得)并将内容类型设置为 NOTIFICATION_CONTENT_CONVERSATION(通过调用 getContentType() 获得)的构造函数。 NotificationContent(NotificationRequest.NotificationNormalContent normalContent) 用于创建 NotificationRequest.NotificationNormalContent 实例(通过调用 getNotificationContent() 获得)并将内容类型设置为 NOTIFICATION_CONTENT_BASIC_TEXT(通过调用 getContentType() 获得)的构造函数。 NotificationContent(NotificationRequest.NotificationPictureContent pictureContent) 用于创建 NotificationRequest.NotificationPictureContent 实例(通过调用 getNotificationContent() 获得)并将内容类型设置为 NOTIFICATION_CONTENT_PICTURE(通过调用 getContentType() 获得)的构造函数。 方法总结 修饰符和类型 方法 描述 int getContentType() 获取通知内容的类型值。 Object getNotificationContent() 获取与当前通知内容匹配的对象。 boolean marshalling(Parcel out) 将 NotificationContent 对象编组到 Parcel 中。 String toString() 返回对象的字符串表示形式。 boolean unmarshalling(Parcel in) 从 Parcel 中解组 NotificationContent 对象。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor 字段详细信息 NOTIFICATION_CONTENT_BASIC_TEXT public static final int NOTIFICATION_CONTENT_BASIC_TEXT 表示基本通知。 此类通知是使用 NotificationRequest.NotificationNormalContent 创建的。 NOTIFICATION_CONTENT_CONVERSATION public static final int NOTIFICATION_CONTENT_CONVERSATION 表示包含多个用户之间对话的通知。 此类通知是使用 NotificationRequest.NotificationConversationalContent 创建的。 NOTIFICATION_CONTENT_LONG_TEXT public static final int...
2024-04-03
NotificationRequest java.lang.Object |—ohos.event.notification.NotificationRequest public final class NotificationRequest extends Object implements Sequenceable 携带通知。 在通知发布方面,需要分别调用 setContent(ohos.event.notification.NotificationRequest.NotificationContent) 方法指定通知内容,调用 setDeliveryTime(long) 方法设置通知的发送时间。 NotificationRequest 在 NotificationHelper#publishNotification(NotificationRequest) 方法中用作输入参数以发布通知。 在通知订阅方面,可以继承 NotificationSubscriber 类,重写回调方法 NotificationSubscriber#onConsumed(NotificationRequest) 和 NotificationSubscriber#onCanceled(NotificationRequest)。 接收或删除的通知可以存储在 NotificationRequest 对象中。 Since: 1 嵌套类摘要 修饰符和类型 类 描述 static class NotificationRequest.NotificationContent 设置要传递给 NotificationRequest#setContent(NotificationRequest.NotificationContent) 方法的通知内容。 static class NotificationRequest.NotificationConversationalContent 构造一个类似对话的通知,其中包括多个用户之间的消息通信。 static class NotificationRequest.NotificationLongTextContent 构造包含长文本的通知。 static class NotificationRequest.NotificationMediaContent 构造一个可以与关联的音频会话交互的媒体播放通知。 static class NotificationRequest.NotificationMultiLineContent 构造一个包含多行文本的通知。 static class NotificationRequest.NotificationNormalContent 构造基本通知。 static class NotificationRequest.NotificationPictureContent 构造包含图片附件的通知。 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static int BADGE_STYLE_BIG 表示此通知的标记显示为大图标。 static int BADGE_STYLE_LITTLE 表示此通知的标记显示为一个小图标。 static int BADGE_STYLE_NONE 表示此通知的标记仅显示数字。 static String CLASSIFICATION_ALARM 指示警报或定时器的通知分类。 static String CLASSIFICATION_CALL 指示传入呼叫或类似同步通信请求的通知分类。 static String CLASSIFICATION_EMAIL 指示电子邮件通知的分类。 static String CLASSIFICATION_ERROR 指示在后台操作或身份验证过程中发生的错误通知的分类。 static String CLASSIFICATION_EVENT 指示日历事件的通知分类。 static String CLASSIFICATION_MESSAGE 指示短消息或即时消息的通知分类。 static String CLASSIFICATION_NAVIGATION 表示地图导航通知的分类。 static String CLASSIFICATION_PROGRESS 表示长时间在后台运行的进程的通知分类。 static String CLASSIFICATION_PROMO 表示广告或促销信息通知的分类。 static String CLASSIFICATION_RECOMMENDATION 指示特定交易的具体及时建议的通知分类。 static String CLASSIFICATION_REMINDER 指示用户先前设置的提醒的通知分类。 static String CLASSIFICATION_SERVICE 指示正在进行的后台服务的通知分类。 static String CLASSIFICATION_SOCIAL 指示社交网络或共享更新通知的分类。 static String CLASSIFICATION_STATUS 指示有关设备和上下文状态的持续信息的通知分类。 static String CLASSIFICATION_SYSTEM 指示系统或设备状态更新通知的分类。 static String...
2024-04-03
NotificationHelper java.lang.Object |—ohos.event.notification.NotificationHelper public class NotificationHelper extends Object 管理通知。 该类提供的方法都是静态的,无需创建该类的对象即可调用。 通常,只有系统应用程序才具有通知订阅和取消订阅的权限。 您可以指定要发布的通知的内容,该内容由 NotificationRequest 携带。 通知ID在应用程序中是唯一的,在使用NotificationRequest承载通知内容时必须指定。 如果具有此 ID 的通知已发布,并且您需要使用此 ID 发布另一个通知,则将更新原始通知。 此外,通知 ID 可用于通过调用 cancelNotification(int) 方法取消通知。 Since: 1 方法总结 修饰符和类型 方法 描述 static void addNotificationSlot(NotificationSlot slot) 创建一个通知槽。 static void addNotificationSlotGroup(NotificationSlotGroup slotGroup) 创建一个通知槽组,通过调用 NotificationSlot#setSlotGroup(String) 可以将 NotificationSlot 对象绑定到该组。 static void addNotificationSlotGroups(ListNotificationSlotGroup slotGroups) 创建多个通知槽组。 static void addNotificationSlots(ListNotificationSlot slots) 创建多个通知槽。 static boolean areNotificationsSuspended() 检查此应用程序是否处于挂起状态。 static void cancelAllNotifications() 取消所有已发布的通知。 static void cancelNotification(int notificationId) 取消已发布的通知。 static void cancelNotification(String label, int notificationId) 取消与指定标签和 notificationId 匹配的已发布通知。 static boolean canPublishNotificationAsBundle(String representativeBundle) 通过以给定代表包指示的另一个应用程序的名称调用 publishNotificationAsBundle(java.lang.String,ohos.event.notification.NotificationRequest) 来检查您的应用程序是否有权发布通知。 static int getActiveNotificationNums() 获取系统中当前应用的活动通知数。 static SetNotificationRequest getActiveNotifications() 获取系统中当前应用程序的活动通知。 static int getBundleImportance() 获取此应用程序的重要性级别。 static NotificationSortingMap getCurrentAppSorting() 获取当前应用的通知排序 map。 static String getNotificationAgent() 获取可以以您的应用程序名称发布通知的应用程序包的名称。 static NotificationSlot getNotificationSlot(String slotId) 查询已创建的通知槽。 static NotificationSlotGroup getNotificationSlotGroup(String slotGroupId) 获取创建的通知槽组。 static ListNotificationSlotGroup getNotificationSlotGroups() 获取创建的通知槽组列表。 static ListNotificationSlot getNotificationSlots() 获取该应用的所有通知槽。 static boolean hasNotificationPolicyAccessPermission() 检查此应用程序是否有权修改请勿打扰 (DND) 通知策略。 static boolean isAllowedNotify() 检查此应用程序是否有权发布通知。 static void publishNotification(String label, NotificationRequest request) 发布带有指定标签的通知。 static void publishNotification(NotificationRequest request) 发布通知。 static void publishNotification(NotificationRequest request, String deviceId) 在指定的远程设备上发布通知。 static void publishNotificationAsBundle(String representativeBundle, NotificationRequest request) 以指定应用程序包的名称发布通知。 static void removeNotificationSlot(String slotId) 根据槽位 ID 删除创建的通知槽位。 static void removeNotificationSlotGroup(String slotGroupId) 根据槽组 ID 删除创建的通知槽组。 static void setNotificationAgent(String agent) 允许另一个应用程序充当代理以您的应用程序包的名称发布通知。 static void setNotificationBadgeNum() 将当前应用程序的活动通知数量设置为要在通知徽章上显示的数量。 static void setNotificationBadgeNum(int num) 设置要在应用程序的通知徽章上显示的数字。 从类 java.lang.Object...
2024-04-03
NotificationConstant java.lang.Object |—ohos.event.notification.NotificationConstant public final class NotificationConstant extends Object 提供静态常量来指示通知删除原因。 常量是调用 NotificationSubscriber#onCanceled(NotificationRequest, NotificationSortingMap, int) 时使用的 int 参数。 Since: 2 嵌套类摘要 修饰符和类型 类 描述 static class NotificationConstant.DisturbMode 枚举免打扰模式的类型。 static class NotificationConstant.InputEditType 枚举在通知中提供给用户的选项的编辑类型。 static class NotificationConstant.InputsSource 枚举用户输入源。 static class NotificationConstant.SemanticActionButton 枚举触发 NotificationActionButton 时关联的 IntentAgent 将采取的操作。 字段摘要 修饰符和类型 字段 描述 static int APP_CANCEL_ALL_REASON_DELETE 表示由于应用程序取消了所有通知而删除了通知。 static int APP_CANCEL_REASON_DELETE 表示由于应用程序取消通知而删除通知。 static int APP_CANCEL_REASON_OTHER 表示通知因其他原因被删除。 static int CANCEL_ALL_REASON_DELETE 表示由于用户清除所有通知而删除通知。 static int CANCEL_REASON_DELETE 表示通知因用户清除而被删除。 static int CLICK_REASON_DELETE 表示通知因为被点击而被删除。 static int ERROR_REASON_DELETE 指示由于 UI 错误而删除通知。 static String EXTRA_INPUTS_SOURCE 键表示输入源。 static int PACKAGE_BANNED_REASON_DELETE 表示由于应用程序被禁止发送通知而删除通知。 static int PACKAGE_CHANGED_REASON_DELETE 表示由于对应用程序进行了更改而删除了通知。 static int USER_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 表示通知因为被点击而被删除。...
2024-04-03
NotificationActionButton.Builder java.lang.Object |—ohos.event.notification.NotificationActionButton.Builder public static final class NotificationActionButton.Builder extends Object NotificationActionButton 对象的生成器类。 Since: 3 构造函数摘要 构造函数 描述 Builder(NotificationActionButton actionButton) 用于通过从现有 NotificationActionButton 对象复制参数来创建 Builder 实例的构造函数。 Builder(PixelMap icon, String title, IntentAgent intentAgent) 用于创建具有指定图标、标题和 IntentAgent 的 Builder 实例的构造函数,用于创建 NotificationActionButton 对象。 方法总结 修饰符和类型 方法 描述 NotificationActionButton.Builder addAdditionalData(PacMap pacMap) 将附加数据添加到此 Builder。 NotificationActionButton.Builder addNotificationUserInput(NotificationUserInput userInput) 添加用于收集用户输入的 NotificationUserInput 对象。 NotificationActionButton build() 使用所有设置创建一个新的 NotificationActionButton 对象。 NotificationActionButton.Builder setAutoCreatedReplies(boolean autoCreatedReplies) 设置是否允许平台自动生成可能的回复并将其添加到 NotificationUserInput#getOptions()。 NotificationActionButton.Builder setContextDependent(boolean isContextual) 设置此 NotificationActionButton 是否为上下文动作,即此 NotificationActionButton 是否依赖于通知消息体。 NotificationActionButton.Builder setSemanticActionButton(NotificationConstant.SemanticActionButton semanticActionButton) 为此 NotificationActionButton 设置语义操作。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 Builder public Builder(PixelMap icon, String title, IntentAgent intentAgent) 用于创建具有指定图标、标题和 IntentAgent 的 Builder 实例的构造函数,用于创建 NotificationActionButton 对象。 参数: 参数名称 参数描述 icon 指示表示此 NotificationActionButton 的图标。 title 指示此 NotificationActionButton 的标题。 intentAgent 指示触发此 NotificationActionButton 时要触发的 IntentAgent。 Since: 3 Builder public Builder(NotificationActionButton actionButton) 用于通过从现有 NotificationActionButton 对象复制参数来创建 Builder 实例的构造函数。 参数: 参数名称 参数描述 actionButton 指示现有的 NotificationActionButton 对象。 Since: 3 方法详情 addNotificationUserInput public NotificationActionButton.Builder addNotificationUserInput(NotificationUserInput userInput) 添加用于收集用户输入的 NotificationUserInput 对象。 参数: 参数名称 参数描述 userInput 指示要添加的 NotificationUserInput 对象。 返回: 返回此 Builder 对象。 Since: 3 setContextDependent public NotificationActionButton.Builder setContextDependent(boolean isContextual) 设置此 NotificationActionButton 是否为上下文动作,即此 NotificationActionButton 是否依赖于通知消息体。...
2024-04-03
NotificationActionButton java.lang.Object |—ohos.event.notification.NotificationActionButton public class NotificationActionButton extends Object implements Sequenceable 封装要在通知中显示的操作按钮。 您可以调用 NotificationRequest#addActionButton 将操作按钮添加到通知。 NotificationActionButton 对象必须包含一个图标、一个标题和一个关联的 IntentAgent,定义了单击操作按钮时要触发的操作。 Since: 3 嵌套类摘要 修饰符和类型 类 描述 static class NotificationActionButton.Builder NotificationActionButton 对象的生成器类。 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static Sequenceable.ProducerNotificationActionButton PRODUCER 从 Parcel 创建 NotificationActionButton 实例。 方法总结 修饰符和类型 方法 描述 PacMap getAdditionalData() 获取包含在此 NotificationActionButton 中的附加数据。 PixelMap getIcon() 获取此 NotificationActionButton 的图标。 IntentAgent getIntentAgent() 获取此 NotificationActionButton 的 IntentAgent。 ListNotificationUserInput getMimeTypeOnlyUserInputs() 在发送此 NotificationActionButton 时,获取仅允许特定 MIME 类型的值的 NotificationUserInput 对象。 int getSemanticActionButton() 获取此 NotificationActionButton 的语义操作。 String getTitle() 获取此 NotificationActionButton 的标题。 ListNotificationUserInput getUserInputs() 获取发送此 NotificationActionButton 时向用户收集的 NotificationUserInput 对象。 boolean isAutoCreatedReplies() 检查平台是否可以自动为此 NotificationActionButton 生成可能的回复。 boolean isContextDependent() 检查此 NotificationActionButton 是否为上下文操作,即此 NotificationActionButton 是否依赖于通知消息体。 boolean marshalling(Parcel out) 将 NotificationActionButton 对象编组到 Parcel 中。 String toString() 返回对象的字符串表示形式。 boolean unmarshalling(Parcel in) 从 Parcel 中解组 NotificationActionButton 对象。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor 字段详细信息 PRODUCER public static final Sequenceable.ProducerNotificationActionButton PRODUCER 从 Parcel 创建 NotificationActionButton 实例。 Since: 4 方法详情 getIcon public PixelMap getIcon() 获取此 NotificationActionButton 的图标。 返回: 返回此 NotificationActionButton 的图标。 Since: 3 getAdditionalData public PacMap getAdditionalData() 获取包含在此 NotificationActionButton 中的附加数据。...
2024-04-03