鴻蒙OS ReminderRequestCalendar

2022-10-13 10:24 更新

ReminderRequestCalendar

java.lang.Object

|---ohos.event.notification.ReminderRequest

|---|---ohos.event.notification.ReminderRequestCalendar

public class ReminderRequestCalendar
extends ReminderRequest

用于為日歷事件創(chuàng)建提醒的 ReminderRequest 子類(lèi)。

您可以使用此類(lèi)在特定日期或特定月份的特定日期的指定時(shí)間(精確到分鐘)發(fā)布日歷事件提醒。

Since:

6

嵌套類(lèi)摘要

從接口 ohos.utils.Sequenceable 繼承的嵌套類(lèi)/接口
Sequenceable.ProducerT

字段摘要

從類(lèi) ohos.event.notification.ReminderRequest 繼承的字段
ACTION_BUTTON_TYPE_CLOSE, ACTION_BUTTON_TYPE_SNOOZE

構(gòu)造函數(shù)摘要

構(gòu)造函數(shù) 描述
ReminderRequestCalendar(LocalDateTime dateTime, int[] repeatMonths, int[] repeatDays) 用于創(chuàng)建 ReminderRequestCalendar 實(shí)例的構(gòu)造函數(shù)。

方法總結(jié)

修飾符和類(lèi)型 方法 描述
boolean marshalling(Parcel out) 將此 Sequenceable 對(duì)象編組為 Parcel。
boolean unmarshalling(Parcel in) 從 Parcel 中解組此 Sequenceable 對(duì)象。
從類(lèi) java.lang.Object 繼承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
從類(lèi) ohos.event.notification.ReminderRequest 繼承的方法
compareTo, equals, getContent, getExpiredContent, getNotificationId, getRingDuration, getSlotId, getSnoozeContent, getSnoozeTimes, getTimeInterval, getTitle, hashCode, setActionButton, setContent, setExpiredContent, setIntentAgent, setMaxScreenIntentAgent, setNotificationId, setRingDuration, setSlotId, setSnoozeContent, setSnoozeTimes, setTimeInterval, setTitle, toString
從接口 ohos.utils.Sequenceable 繼承的方法
hasFileDescriptor

構(gòu)造函數(shù)詳細(xì)信息

ReminderRequestCalendar

public ReminderRequestCalendar(LocalDateTime dateTime, int[] repeatMonths, int[] repeatDays)

用于創(chuàng)建 ReminderRequestCalendar 實(shí)例的構(gòu)造函數(shù)。 日歷事件提醒將在指定時(shí)間觸發(fā)。

確保輸入?yún)?shù)滿足以下要求。 否則,應(yīng)用程序可能會(huì)因?yàn)榉欠▍?shù)異常而崩潰。

  • dateTime 參數(shù)不能為空。
  • repeatMonths 參數(shù)不能為空。
  • repeatDays 參數(shù)不能為空。
  • repeatMonths 數(shù)組的長(zhǎng)度不能超過(guò) 12。
  • repeatDays 數(shù)組的長(zhǎng)度不能超過(guò) 31。
  • 必須至少有一個(gè)有效的提醒時(shí)間。 確保 dateTime 指定的時(shí)間沒(méi)有過(guò)期,或者 repeatMonths 和 repeatDays 有效。

參數(shù):

參數(shù)名稱(chēng) 參數(shù)描述
dateTime 指示將觸發(fā)此日歷事件提醒的日期和時(shí)間。 時(shí)間精確到分鐘。 例如,LocalDateTime.of(2021, 3, 3, 16, 15) 的值表示提醒將在 2021 年 3 月 3 日 16:15 觸發(fā)。
repeatMonths 指示重復(fù)此提醒的月份。 例如,值 {2, 4} 表示提醒將在 2 月和 4 月的特定日期觸發(fā)。
repeatDays 指示每月重復(fù)此提醒的日期。 例如,值 {2, 4} 表示將在特定月份的第二天和第四天觸發(fā)提醒。 必須同時(shí)設(shè)置repeatMonths 和repeatDays 參數(shù)才能實(shí)現(xiàn)重復(fù)提醒。 默認(rèn)情況下,此提醒不會(huì)被延后。 您可以調(diào)用 ReminderRequest.setTimeInterval(long) 來(lái)設(shè)置貪睡間隔。 如果設(shè)置了打盹間隔,該提醒會(huì)默認(rèn)打盹3次。 您可以調(diào)用 ReminderRequest.setSnoozeTimes(int) 來(lái)更改貪睡時(shí)間。

Since:

6

方法詳情

marshalling

public boolean marshalling(Parcel out)

從接口復(fù)制的描述:Sequenceable

將此 Sequenceable 對(duì)象編組為 Parcel。

指定者:

接口 Sequenceable 中的編組

覆蓋:

在類(lèi) ReminderRequest 中編組

參數(shù):

參數(shù)名稱(chēng) 參數(shù)描述
out 指示將 Sequenceable 對(duì)象編組到的 Parcel 對(duì)象。

返回:

如果編組成功,則返回 true; 否則返回 false。

unmarshalling

public boolean unmarshalling(Parcel in)

從接口復(fù)制的描述:Sequenceable

從 Parcel 中解組此 Sequenceable 對(duì)象。

指定者:

在接口 Sequenceable 中解組

覆蓋:

在 ReminderRequest 類(lèi)中解組

參數(shù):

參數(shù)名稱(chēng) 參數(shù)描述
in 指示已將 Sequenceable 對(duì)象編組到的 Parcel 對(duì)象。

返回:

如果解組成功,則返回 true; 否則返回 false。

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)