Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

0 votes
0 answers
16 views

Start Multiple Work of the same type with WorkManager

I want to start multiple image caching work in parallel with WorkManager. It will be using CacheImageWorker class. The data is retrieved from external input. The codes will look like this: val ...
wiryadev's user avatar
  • 1,361
0 votes
0 answers
151 views

How to force WorkManager to do work when app is NOT running?

I have a work that I want to run immediately when app starts running. but I'm only using Coroutines for that. After app is killed I want to schedule WorkManager to continue that work. Is that possible ...
mrzbn's user avatar
  • 625
0 votes
0 answers
453 views

Logical solution for solve the WorkManager's Exception java.lang.IllegalStateException Data cannot occupy more than 10240 bytes when serialized

I'm trying to pass the String data(>10240 bytes) to the Worker class and process the data within that, as per the Developer documentation of Worker, if it's more than 10240 bytes that will throw an ...
FGH's user avatar
  • 3,988
2 votes
1 answer
1k views

how do I access ViewModel inside Work Manager

I'm trying to access ViewModel using hilt inside the worker class which I created but unable to do so, can anyone help please?
ismail M's user avatar
  • 187
0 votes
1 answer
37 views

executing task in a user defined time interval using work manager

I have a use case, in which I take input from the user of a time interval. For example, the user chooses 10 pm to 4 am. During this time interval, I want to basically track the screen time of the ...
Sohail Shah's user avatar
3 votes
0 answers
519 views

Enqueued unique work with different input data with APPTND_OR_REPLACE but in worker resulted in same as what passed the first request

Component used:androidx.work/WorkManager (androidx.work:work-runtime) Version used:2.7.1 Devices/Android versions reproduced on: Android 10 I have enqueued many OneTimeUniqueWorkRequest with ...
ISNing's user avatar
  • 31
2 votes
1 answer
819 views

Android WorkManager Network Constraint For Both Wifi and Data (Cellular)

I am learning WorkManager and wondering if following the correct way of setting network constraint for both Wifi and data (cellular): val constraints = Constraints.Builder().run { ...
Sam Chen's user avatar
  • 8,533
1 vote
1 answer
880 views

Unable to catch CancellationException in CoroutineWorker (WorkManager)

I am using a CoroutineWorker of WorkManager to download a long video. The download progress is shown in the notification along with an action to cancel the ongoing download. When the cancel action is ...
Mehul Kanzariya's user avatar
1 vote
2 answers
2k views

Unable to update progress in ProgressBar of Notification using WorkManager

I want to create a long-running worker for downloading a video. As per my understanding, we should call createForegroundInfo() to update the ongoing notification. However, I can't find the information ...
Mehul Kanzariya's user avatar
0 votes
0 answers
974 views

android-execute a worker at roughly the same time every day

according to this medium article from Android Developers: At the moment, if you need to execute a worker at roughly the same time, every day, your best option is to use a OneTimeWorkRequest with an ...
Soheil's user avatar
  • 607
9 votes
2 answers
4k views

Expedited WorkRequests require a ListenableWorker to provide an implementation for getForegroundInfoAsync()

Doing a little Jeopardy style Q&A here. I have some work I sometimes need to run as expedited as described in the version 2.7.0 of WorkManager: val constraints = Constraints.Builder() ....
Roy Solberg's user avatar
0 votes
1 answer
454 views

Android - Looping worker for 1 minute

I've been searching for lots of articles about how to run a specific functions and methods within a certain time, for example, 5 minutes but I couldn't find at least a similar case with mine. Now, in ...
Anne's user avatar
  • 31
1 vote
1 answer
437 views

How to update timeInterval for PeriodicWorkRequest after doWork() call

I'm new to Work manager in android and I want to update the timeInterval of PeriodicWorkRequest once I got the response from server. Here is my sample code where I'm trying to update the timeInterval. ...
Suresh's user avatar
  • 429
0 votes
1 answer
115 views

Testing WorkManager - RUNNING instead of ENQUEUED

I am following this example, but my test fails, since workInfo.state is RUNNING instead of ENQUEUED. Does anyone know what might be the issue? Please let me know if I should provide more code/context.
shko's user avatar
  • 94
1 vote
1 answer
143 views

Schedule periodic local notification based on specific dates

I want to make a periodic worker to schedule notifications based on the total number of customer collection dates. I already did apart, but I'm facing a problem. Objective: Check if there is a ...
Amine Karimi's user avatar

15 30 50 per page
1
2 3 4 5
9