Notification.Builder.SetSound Method

Definition

Overloads

Name Description
SetSound(Uri)

This method was deprecated in API level 26.

SetSound(Uri, AudioAttributes)

This method was deprecated in API level 26.

SetSound(Uri, Stream)
Obsolete.

This method was deprecated in API level 21.

SetSound(Uri)

This method was deprecated in API level 26.

[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

Uri

Returns

This Android.App.Notification.Builder instance, allowing calls to be chained.

Attributes

Remarks

This method was deprecated in API level 26. use NotificationChannel.setSound(Uri,AudioAttributes) instead.

Set the sound to play. It will be played using the default audio attributes for notifications.

Android reference for android.app.Notification.Builder.setSound.

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, AudioAttributes)

This method was deprecated in API level 26.

[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

Uri

audioAttributes
AudioAttributes

AudioAttributes

Returns

This Android.App.Notification.Builder instance, allowing calls to be chained.

Attributes

Remarks

This method was deprecated in API level 26. use NotificationChannel.setSound(Uri,AudioAttributes) instead.

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

See also:

Android reference for android.app.Notification.Builder.setSound.

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

This method was deprecated in API level 21.

[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

Uri

streamType
Stream

int

Returns

This Android.App.Notification.Builder instance, allowing calls to be chained.

Attributes

Remarks

This method was deprecated in API level 21. use NotificationChannel.setSound(Uri,AudioAttributes).

Set the sound to play, along with a specific stream on which to play it. See AudioManager for the STREAM_ constants.

Android reference for android.app.Notification.Builder.setSound.

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