Notification.Builder.SetDefaults(NotificationDefaults) Method

Definition

This method was deprecated in API level 26.

[Android.Runtime.Register("setDefaults", "(I)Landroid/app/Notification$Builder;", "GetSetDefaults_IHandler")]
public virtual Android.App.Notification.Builder? SetDefaults(Android.App.NotificationDefaults defaults);
[<Android.Runtime.Register("setDefaults", "(I)Landroid/app/Notification$Builder;", "GetSetDefaults_IHandler")>]
abstract member SetDefaults : Android.App.NotificationDefaults -> Android.App.Notification.Builder
override this.SetDefaults : Android.App.NotificationDefaults -> Android.App.Notification.Builder

Parameters

defaults
NotificationDefaults

int

Returns

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

Attributes

Remarks

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

Set which notification properties will be inherited from system defaults. The value should be one or more of the following fields combined with bitwise-or: Notification.DEFAULT_SOUND, Notification.DEFAULT_VIBRATE, Notification.DEFAULT_LIGHTS. For all default values, use Notification.DEFAULT_ALL.

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

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