The Android Developer Challenge is back! Submit your idea before December 2.

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 Context: The UUID identifying the ListenableWorker
foregroundInfo Context: 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.