次の方法で共有


NotificationChannel.SetSound(Uri, AudioAttributes) Method

Definition

Sets the sound that should be played for notifications posted to this channel and its audio attributes.

[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

Parameters

sound
Uri
audioAttributes
AudioAttributes
Attributes

Remarks

Sets the sound that should be played for notifications posted to this channel and its audio attributes. Notification channels with an #getImportance() importance of at least NotificationManager#IMPORTANCE_DEFAULT should have a sound.

Only modifiable before the channel is submitted to NotificationManager#createNotificationChannel(NotificationChannel).

Java documentation for android.app.NotificationChannel.setSound(android.net.Uri, android.media.AudioAttributes).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to