Tracking WorkManager's Progress

Get status updates from WorkManager.

When you need visibility into WorkManager's progress, use LiveData. First, get an instance of WorkManager and call getWorkInfoByIdLiveData, passing in the downloadPodcasts variable.

WorkManager.getInstance().getWorkInfoByIdLiveData(downloadPodcasts.id).observe(this, Observer { status ->

 })

Once we're inside the Observer, do a quick null check:

            if (status != null) {

            }

If everything is good, see if the state is SUCCEEDED.


                if (status.state == WorkInfo.State.SUCCEEDED) {
                    d("daniel", "thank goodness, it's done! :)")
                }

More Tutorials

Android Basic Alert Dialog Box
Basic CardView

Basic CardView

Material Design.

Rounded Corners with a Border
Rounded Button in Android Studio

Rounded Button in Android Studio

Create beautiful buttons in XML.

RecyclerView Day 3: Invoicing app

RecyclerView Day 3: Invoicing app

Built with Android Studio and Kotlin.

Build a Ridesharing Android App - Part 1

Build a Ridesharing Android App - Part 1

Getting started is sometimes the hardest part.

setOnClickListener

Add a click listener in Kotlin.

Android Login Layout

Let users sign in.

Registration Screen

Registration Screen

It always begins with registration.