新聞中心
NotificationActionButton

java.lang.Object
|---ohos.event.notification.NotificationActionButton
public class NotificationActionButton
extends Object
implements Sequenceable封裝要在通知中顯示的操作按鈕。 您可以調(diào)用 NotificationRequest#addActionButton 將操作按鈕添加到通知。
NotificationActionButton 對(duì)象必須包含一個(gè)圖標(biāo)、一個(gè)標(biāo)題和一個(gè)關(guān)聯(lián)的 IntentAgent,定義了單擊操作按鈕時(shí)要觸發(fā)的操作。
Since:
3
嵌套類摘要
| 修飾符和類型 | 類 | 描述 |
|---|---|---|
| static class | NotificationActionButton.Builder | NotificationActionButton 對(duì)象的生成器類。 |
| 從接口 ohos.utils.Sequenceable 繼承的嵌套類/接口 |
|---|
| Sequenceable.ProducerT |
字段摘要
| 修飾符和類型 | 字段 | 描述 |
|---|---|---|
| static Sequenceable.ProducerNotificationActionButton | PRODUCER | 從 Parcel 創(chuàng)建 NotificationActionButton 實(shí)例。 |
方法總結(jié)
| 修飾符和類型 | 方法 | 描述 |
|---|---|---|
| PacMap | getAdditionalData() | 獲取包含在此 NotificationActionButton 中的附加數(shù)據(jù)。 |
| PixelMap | getIcon() | 獲取此 NotificationActionButton 的圖標(biāo)。 |
| IntentAgent | getIntentAgent() | 獲取此 NotificationActionButton 的 IntentAgent。 |
| ListNotificationUserInput | getMimeTypeOnlyUserInputs() | 在發(fā)送此 NotificationActionButton 時(shí),獲取僅允許特定 MIME 類型的值的 NotificationUserInput 對(duì)象。 |
| int | getSemanticActionButton() | 獲取此 NotificationActionButton 的語義操作。 |
| String | getTitle() | 獲取此 NotificationActionButton 的標(biāo)題。 |
| ListNotificationUserInput | getUserInputs() | 獲取發(fā)送此 NotificationActionButton 時(shí)向用戶收集的 NotificationUserInput 對(duì)象。 |
| boolean | isAutoCreatedReplies() | 檢查平臺(tái)是否可以自動(dòng)為此 NotificationActionButton 生成可能的回復(fù)。 |
| boolean | isContextDependent() | 檢查此 NotificationActionButton 是否為上下文操作,即此 NotificationActionButton 是否依賴于通知消息體。 |
| boolean | marshalling(Parcel out) | 將 NotificationActionButton 對(duì)象編組到 Parcel 中。 |
| String | toString() | 返回對(duì)象的字符串表示形式。 |
| boolean | unmarshalling(Parcel in) | 從 Parcel 中解組 NotificationActionButton 對(duì)象。 |
| 從類 java.lang.Object 繼承的方法 |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 從接口 ohos.utils.Sequenceable 繼承的方法 |
|---|
| hasFileDescriptor |
字段詳細(xì)信息
PRODUCER
public static final Sequenceable.ProducerNotificationActionButton PRODUCER
從 Parcel 創(chuàng)建 NotificationActionButton 實(shí)例。
Since:
4
方法詳情
getIcon
public PixelMap getIcon()
獲取此 NotificationActionButton 的圖標(biāo)。
返回:
返回此 NotificationActionButton 的圖標(biāo)。
Since:
3
getAdditionalData
public PacMap getAdditionalData()
獲取包含在此 NotificationActionButton 中的附加數(shù)據(jù)。
返回:
返回此 NotificationActionButton 中包含的附加數(shù)據(jù)。
Since:
3
getUserInputs
public ListNotificationUserInput getUserInputs()
獲取發(fā)送此 NotificationActionButton 時(shí)向用戶收集的 NotificationUserInput 對(duì)象。
返回:
返回 NotificationUserInput 對(duì)象的列表。
Since:
3
getMimeTypeOnlyUserInputs
public ListNotificationUserInput getMimeTypeOnlyUserInputs()
在發(fā)送此 NotificationActionButton 時(shí),獲取僅允許特定 MIME 類型的值的 NotificationUserInput 對(duì)象。
返回:
返回僅允許特定 MIME 類型值的 NotificationUserInput 對(duì)象列表。
Since:
3
isAutoCreatedReplies
public boolean isAutoCreatedReplies()
檢查平臺(tái)是否可以自動(dòng)為此 NotificationActionButton 生成可能的回復(fù)。
返回:
如果平臺(tái)可以生成回復(fù),則返回 true; 否則返回 false。
Since:
3
isContextDependent
public boolean isContextDependent()
檢查此 NotificationActionButton 是否為上下文操作,即此 NotificationActionButton 是否依賴于通知消息體。 例如,上下文 NotificationActionButton 在通知中為用戶打開地圖應(yīng)用程序提供地址。
返回:
如果此 NotificationActionButton 是上下文操作,則返回 true; 否則返回 false。
Since:
3
getTitle
public String getTitle()
獲取此 NotificationActionButton 的標(biāo)題。
返回:
返回此 NotificationActionButton 的標(biāo)題。
Since:
3
getIntentAgent
public IntentAgent getIntentAgent()
獲取此 NotificationActionButton 的 IntentAgent。
返回:
返回此 NotificationActionButton 的 IntentAgent。
Since:
3
getSemanticActionButton
public int getSemanticActionButton()
獲取此 NotificationActionButton 的語義操作。
返回:
返回此 NotificationActionButton 的語義操作,如 NotificationConstant.SemanticActionButton 中所枚舉。
Since:
3
marshalling
public boolean marshalling(Parcel out)
將 NotificationActionButton 對(duì)象編組到 Parcel 中。
進(jìn)程可以調(diào)用 unmarshalling(ohos.utils.Parcel) 方法從 Parcel 中解組 NotificationActionButton 對(duì)象,以實(shí)現(xiàn)進(jìn)程間通信 (IPC)。
指定者:
接口 Sequenceable 中的編組
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| out | 指示用于編組的 MessageParcel 對(duì)象。 MessageParcel 是 Parcel 的子類。 |
返回:
如果編組成功,則返回 true; 否則返回 false。
Since:
4
unmarshalling
public boolean unmarshalling(Parcel in)
從 Parcel 中解組 NotificationActionButton 對(duì)象。
指定者:
在接口 Sequenceable 中解組
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| in | 指示用于編組的 MessageParcel 對(duì)象。 MessageParcel 是 Parcel 的子類。 |
返回:
如果解組成功,則返回 true; 否則返回 false。
Since:
4
toString
public String toString()
從類復(fù)制的描述:對(duì)象
返回對(duì)象的字符串表示形式。 通常,toString 方法返回一個(gè)“以文本方式表示”該對(duì)象的字符串。 結(jié)果應(yīng)該是一個(gè)簡潔但信息豐富的表示,易于人們閱讀。 建議所有子類重寫此方法。
Object 類的 toString 方法返回一個(gè)字符串,該字符串由對(duì)象作為其實(shí)例的類的名稱、at 符號(hào)字符“@”和對(duì)象哈希碼的無符號(hào)十六進(jìn)制表示形式組成。 換句話說,此方法返回一個(gè)等于以下值的字符串:
getClass().getName() + '@' + Integer.toHexString(hashCode()) 覆蓋:
類 Object 中的 toString
返回:
對(duì)象的字符串表示形式。
Since:
4
網(wǎng)站題目:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSNotificationActionButton
網(wǎng)站地址:http://www.5511xx.com/article/cceopip.html


咨詢
建站咨詢
