NotificationChannel.SetSound(Uri, AudioAttributes) メソッド

定義

このチャネルに投稿された通知とそのオーディオ属性に対して再生するサウンドを設定します。

[Android.Runtime.Register("setSound", "(Landroid/net/Uri;Landroid/media/AudioAttributes;)V", "", ApiSince=26)]
public void SetSound (Android.Net.Uri? sound, Android.Media.AudioAttributes? audioAttributes);
[<Android.Runtime.Register("setSound", "(Landroid/net/Uri;Landroid/media/AudioAttributes;)V", "", ApiSince=26)>]
member this.SetSound : Android.Net.Uri * Android.Media.AudioAttributes -> unit

パラメーター

sound
Uri
audioAttributes
AudioAttributes
属性

注釈

このチャネルに投稿された通知とそのオーディオ属性に対して再生するサウンドを設定します。 の通知チャネルには #getImportance() importance 、少なくとも NotificationManager#IMPORTANCE_DEFAULT サウンドが必要です。

チャネルが に NotificationManager#createNotificationChannel(NotificationChannel)送信される前にのみ変更可能です。

android.app.NotificationChannel.setSound(android.net.Uri, android.media.AudioAttributes)Java ドキュメント。

このページの一部は、によって作成および共有された作業に基づく変更であり、に記載されている条件に従って使用されます。

適用対象