ForegroundInfo
class ForegroundInfo
The information required when a ListenableWorker runs in the context of a foreground service.
Summary
Public constructors |
|---|
ForegroundInfo(notificationId: Int, notification: Notification)Creates an instance of |
ForegroundInfo(Creates an instance of |
Public constructors
ForegroundInfo
ForegroundInfo(notificationId: Int, notification: Notification)
Creates an instance of ForegroundInfo with a Notification.
On API 29 and above, you can specify a foregroundServiceType by using the ForegroundInfo constructor; otherwise, a default
foregroundServiceType of 0 will be used.
| Parameters | |
|---|---|
notificationId: Int |
The |
notification: Notification |
The |
ForegroundInfo
ForegroundInfo(
notificationId: Int,
notification: Notification,
foregroundServiceType: Int
)
Creates an instance of ForegroundInfo with a Notification and foreground android.app.Service type. For more information look at android.app.Service#startForeground(int,
Notification, int).
| Parameters | |
|---|---|
notificationId: Int |
The |
notification: Notification |
The |
foregroundServiceType: Int |
The foreground |
Public functions
getForegroundServiceType
fun getForegroundServiceType(): Int
| Returns | |
|---|---|
Int |
The foreground |
getNotification
fun getNotification(): Notification
| Returns | |
|---|---|
Notification |
The user visible |
getNotificationId
fun getNotificationId(): Int
| Returns | |
|---|---|
Int |
The |