Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
object NewMessageManager {
fun send(newMessage: NewMessage) {
val data = Data.Builder()
.putString(NewMessage.KEY_JOB_ID, newMessage.jobId)
.build()
val woker = OneTimeWorkRequest.Builder(NewMessageCreationWorker::class.java)
.setInputData(data)
.setConstraints(Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build())
.build()
WorkManager.getInstance().enqueue(worker)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.