ForegroundUpdater


interface ForegroundUpdater


Manages updating android.app.Notifications when a ListenableWorker transitions to running in the context of a foreground android.app.Service.

Summary

Public functions

ListenableFuture<Void!>
setForegroundAsync(
    context: Context,
    id: UUID,
    foregroundInfo: ForegroundInfo
)

Public functions

setForegroundAsync

Added in 2.3.0
fun setForegroundAsync(
    context: Context,
    id: UUID,
    foregroundInfo: ForegroundInfo
): ListenableFuture<Void!>
Parameters
context: Context

The application Context.

id: UUID

The UUID identifying the ListenableWorker

foregroundInfo: ForegroundInfo

The ForegroundInfo

Returns
ListenableFuture<Void!>

@return The ListenableFuture which resolves after the ListenableWorker transitions to running in the context of a foreground android.app.Service.