-
-
Save kasem-sm/803aced03a405066437e40e4accb466f to your computer and use it in GitHub Desktop.
When Jetpack's Glance met his fellow worker, Work Manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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