I need to pass complex object to WorkManager. Or I need to serialize object which contains Livedata and Date.
It throws java.lang.IllegalArgumentException: Key cabinId2 has invalid type class com.example.sonyadmin.data.Task
val data = workDataOf("cabinId2" to task)
val uploadWorkRequest = OneTimeWorkRequestBuilder<WManager>()
.setInputData(data)
.build()
reference
a confusing word to use here. Don't send references, because those references might not be available when the OS launches the work again later. Uri is the only type of reference that will be available, so its clearer to say Uri. – Silberman