共用方式為


NotificationListenerService.UpdateNotificationChannel 方法

定義

為指定使用者更新指定套件的通知通道。

[Android.Runtime.Register("updateNotificationChannel", "(Ljava/lang/String;Landroid/os/UserHandle;Landroid/app/NotificationChannel;)V", "", ApiSince=26)]
public void UpdateNotificationChannel (string pkg, Android.OS.UserHandle user, Android.App.NotificationChannel channel);
[<Android.Runtime.Register("updateNotificationChannel", "(Ljava/lang/String;Landroid/os/UserHandle;Landroid/app/NotificationChannel;)V", "", ApiSince=26)>]
member this.UpdateNotificationChannel : string * Android.OS.UserHandle * Android.App.NotificationChannel -> unit

參數

pkg
String

通道所屬的封裝。

user
UserHandle

通道所屬的使用者。

channel
NotificationChannel

要更新的通道。

屬性

備註

為指定使用者更新指定套件的通知通道。 這應該只用來反映使用者透過接聽程式的使用者介面對通道所做的變更。

如果您無法存取指定使用者的通知,這個方法將會擲回安全性例外狀況。

呼叫端必須有 CompanionDeviceManager#getAssociations() an associated device 才能使用這個方法。

android.service.notification.NotificationListenerService.updateNotificationChannel(java.lang.String, android.os.UserHandle, android.app.NotificationChannel)Java 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於