Service.ForegroundServiceType Property

Definition

If the service has become a foreground service by calling #startForeground(int, Notification) or #startForeground(int, Notification, int), #getForegroundServiceType() returns the current foreground service type.

public Android.Content.PM.ForegroundService ForegroundServiceType { [Android.Runtime.Register("getForegroundServiceType", "()I", "", ApiSince=29)] get; }
[<get: Android.Runtime.Register("getForegroundServiceType", "()I", "", ApiSince=29)>]
member this.ForegroundServiceType : Android.Content.PM.ForegroundService

Property Value

current foreground service type flags.

Attributes

Remarks

If the service has become a foreground service by calling #startForeground(int, Notification) or #startForeground(int, Notification, int), #getForegroundServiceType() returns the current foreground service type.

If there is no foregroundServiceType specified in manifest, ServiceInfo#FOREGROUND_SERVICE_TYPE_NONE is returned.

If the service is not a foreground service, ServiceInfo#FOREGROUND_SERVICE_TYPE_NONE is returned.

Java documentation for android.app.Service.getForegroundServiceType().

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