android / architecture-components-samples

Samples for Android Architecture Components.
https://d.android.com/arch
Apache License 2.0
23.4k stars 8.29k forks source link

Request: for WorkManager sample, show how to update the notification, and also how to perform UI-thread operations #974

Open AndroidDeveloperLB opened 3 years ago

AndroidDeveloperLB commented 3 years ago

The docs write about using setForegroundAsync, but the sample doesn't show it: https://developer.android.com/topic/libraries/architecture/workmanager/advanced/long-running

Also, please show how to perform operations on the UI thread on the new CoroutineWorker. I don't see any function annotated with WorkerThread/UiThread which is confusing. That's true in both Kotlin and Java.