Wpis z mikrobloga

#androiddev #android #programowanie
Dzięki Ci pieprzony Googlu! Po 10 latach masz normalny menadżer do odpalania tasków w tle! Koniec #!$%@? się z AlarmManagerami, JobSchedulerami, FirebaseSchedulerami :)

public class MyWorker extends Worker {
@Override
public Worker.WorkerResult doWork() {

// Do the work here--in this case,
//This method will run on background thread
myWork();

// Indicate success or failure with your return value:
return WorkerResult.SUCCESS;

// (Returning RETRY tells WorkManager to try this task again
// later; FAILURE says not to try again.)
}
}
  • 1
  • Odpowiedz