show notification when task is enqueued in work manager

339 Views Asked by At

I have a video uploading work that is handled by the work manager. When the user clicks the upload button, I want to show the notification with indeterminate progress bar and when the task starts, show the progress in the same notification.

I passed the notificationID to the work through workData and the progress is shown properly.

The issue is: If there is no internet connection, the indeterminate progress bar is shown and the work is not started (It is enqueued). When I close the app, the indeterminate progress bar is also dismissed and the enqueued task is not shown to the user.

How to make sure the notification persist even on app close or when the work manager has work enqueued to it?

0

There are 0 best solutions below