Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Input and output data for a task
val userIdData = Data.Builder()
.putInt(DATA_USER_ID, userId)
.build()
val syncOnlyOnce = OneTimeWorkRequestBuilder<SyncWorker>()
.setInputData(userIdData)
.build()
val userIdInput = inputData.getInt(Constants.DATA_USER_ID, 0)
// ktx
val outputData = workDataOf(Constants.DATA_SENT to isDataSent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment