Skip to content

Instantly share code, notes, and snippets.

@kasem-sm
Created May 30, 2022
Embed
What would you like to do?
When Jetpack's Glance met his fellow worker, Work Manager
override suspend fun doWork(): Result {
val article = api.getFromUsersSubscription().mapToEntity()
return try {
// Update the widget's text content.
// suspending function
updateWidget(article.title, context)
Result.success()
} catch(e: Exception) {
Result.retry()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment