Share via


Notification.Builder.SetSound Method

Definition

Overloads

SetSound(Uri)

Set the alert sound to play.

SetSound(Uri, AudioAttributes)

Set the alert sound to play, along with sound attributes to use during playback.

SetSound(Uri, Stream)
Obsolete.

Set the sound to play, along with a specific stream on which to play it.

SetSound(Uri)

Set the alert sound to play.

[Android.Runtime.Register("setSound", "(Landroid/net/Uri;)Landroid/app/Notification$Builder;", "GetSetSound_Landroid_net_Uri_Handler")]
public virtual Android.App.Notification.Builder? SetSound (Android.Net.Uri? sound);
[<Android.Runtime.Register("setSound", "(Landroid/net/Uri;)Landroid/app/Notification$Builder;", "GetSetSound_Landroid_net_Uri_Handler")>]
abstract member SetSound : Android.Net.Uri -> Android.App.Notification.Builder
override this.SetSound : Android.Net.Uri -> Android.App.Notification.Builder

Parameters

sound
Uri

The URI for the sound to be played when the notification is posted.

Returns

Attributes

Remarks

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.

See also

Applies to

SetSound(Uri, AudioAttributes)

Set the alert sound to play, along with sound attributes to use during playback.

[Android.Runtime.Register("setSound", "(Landroid/net/Uri;Landroid/media/AudioAttributes;)Landroid/app/Notification$Builder;", "GetSetSound_Landroid_net_Uri_Landroid_media_AudioAttributes_Handler")]
public virtual Android.App.Notification.Builder? SetSound (Android.Net.Uri? sound, Android.Media.AudioAttributes? audioAttributes);
[<Android.Runtime.Register("setSound", "(Landroid/net/Uri;Landroid/media/AudioAttributes;)Landroid/app/Notification$Builder;", "GetSetSound_Landroid_net_Uri_Landroid_media_AudioAttributes_Handler")>]
abstract member SetSound : Android.Net.Uri * Android.Media.AudioAttributes -> Android.App.Notification.Builder
override this.SetSound : Android.Net.Uri * Android.Media.AudioAttributes -> Android.App.Notification.Builder

Parameters

sound
Uri

The URI for the sound to be played when the notification is posted.

audioAttributes
AudioAttributes

A collection of AudioAttributes that specifies the characteristics of the audio stream during playback.

Returns

Attributes

Remarks

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

SetSound(Uri, Stream)

Caution

deprecated

Set the sound to play, along with a specific stream on which to play it.

[Android.Runtime.Register("setSound", "(Landroid/net/Uri;I)Landroid/app/Notification$Builder;", "GetSetSound_Landroid_net_Uri_IHandler")]
[System.Obsolete("deprecated")]
public virtual Android.App.Notification.Builder? SetSound (Android.Net.Uri? sound, Android.Media.Stream streamType);
[<Android.Runtime.Register("setSound", "(Landroid/net/Uri;I)Landroid/app/Notification$Builder;", "GetSetSound_Landroid_net_Uri_IHandler")>]
[<System.Obsolete("deprecated")>]
abstract member SetSound : Android.Net.Uri * Android.Media.Stream -> Android.App.Notification.Builder
override this.SetSound : Android.Net.Uri * Android.Media.Stream -> Android.App.Notification.Builder

Parameters

sound
Uri

The URI for the sound to be played when the notification is posted.

streamType
Stream

The stream on which to play the sound.

Returns

Attributes

Remarks

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.

See also

Applies to