Anyone know how to get outputData on PeriodicWork?...
# android
k
Anyone know how to get outputData on PeriodicWork? I have spend too much time for search about this, but all the solutions I have found don't affect anything. I know this case isn't specific to Kotlin, but I use workmanager-ktx library and coroutines for this task. this is my code to get the outputData
Copy code
workManager.getWorkInfoByIdLiveData(periodicRefreshToken.id)
                        .observe(this@HomeLoggedInActivity) {
                            if (it != null && it.state.isFinished) {
                                token = it.outputData.getString(NEW_TOKEN) ?: ""
                                tokenViewModel.setAccessToken(token)
                            }
                        }
😶 2