Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//Create constraints
Constraints constraints = new Constraints.Builder().setRequiredNetworkType
(NetworkType.CONNECTED).build();
//create work
Work uploadWork = new Work.Builder(LocationUploadWorker.class).withConstraints
(constraints).build();
//schedule work
WorkManager.getInstance(this).enqueue(uploadWork);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment