Notification.Builder.SetForegroundServiceBehavior(Int32) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Spécifiez une stratégie de visibilité souhaitée pour une notification associée à un service de premier plan.
[Android.Runtime.Register("setForegroundServiceBehavior", "(I)Landroid/app/Notification$Builder;", "GetSetForegroundServiceBehavior_IHandler", ApiSince=31)]
public virtual Android.App.Notification.Builder SetForegroundServiceBehavior(int behavior);
[<Android.Runtime.Register("setForegroundServiceBehavior", "(I)Landroid/app/Notification$Builder;", "GetSetForegroundServiceBehavior_IHandler", ApiSince=31)>]
abstract member SetForegroundServiceBehavior : int -> Android.App.Notification.Builder
override this.SetForegroundServiceBehavior : int -> Android.App.Notification.Builder
Paramètres
- behavior
- Int32
int : l’une des valeurs FOREGROUND_SERVICE_DEFAULT, FOREGROUND_SERVICE_IMMEDIATE ou FOREGROUND_SERVICE_DEFERRED est l’une des options suivantes : Notification.FOREGROUND_SERVICE_DEFAULT Notification.FOREGROUND_SERVICE_IMMEDIATE Notification.FOREGROUND_SERVICE_DEFERRED
Retours
Cette instance Android.App.Notification.Builder, autorisant les appels à être chaînés.
- Attributs
Remarques
Spécifiez une stratégie de visibilité souhaitée pour une notification associée à un service de premier plan. Par défaut, le système peut choisir de différer la visibilité de la notification pendant un court instant après le démarrage du service. Passez FOREGROUND_SERVICE_IMMEDIATE à cette méthode afin de garantir que la visibilité n’est jamais différée. Transmettez FOREGROUND_SERVICE_DEFERRED pour demander que la visibilité soit différée dans la mesure du possible. Notez que la visibilité différée n’est pas garantie. Il peut y avoir certaines circonstances dans lesquelles le système affiche immédiatement la notification associée au service de premier plan, même lorsque l’application a utilisé cette méthode pour demander explicitement l’affichage différé.
Référence Android pour android.app.Notification.Builder.setForegroundServiceBehavior.
Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.