Google is committed to advancing racial equity for Black communities. See how.

ForegroundUpdater

interface ForegroundUpdater
androidx.work.ForegroundUpdater

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

Summary

Public methods

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

Public methods

setForegroundAsync

@NonNull abstract fun setForegroundAsync(
    @NonNull context: Context,
    @NonNull id: UUID,
    @NonNull foregroundInfo: ForegroundInfo
): ListenableFuture<Void!>
Parameters
context Context: The application Context.
id UUID: The UUID identifying the ListenableWorker
foregroundInfo ForegroundInfo: The ForegroundInfo
Return
ListenableFuture<Void!> @return The ListenableFuture which resolves after the ListenableWorker transitions to running in the context of a foreground android.app.Service.