Skip to content

Instantly share code, notes, and snippets.

Last active Jun 1, 2022
What would you like to do?
When Jetpack's Glance met his fellow worker, Work Manager
suspend fun updateWidget(articleTitle: String, context: Context) {
// Iterate through all the available glance id's.
GlanceAppWidgetManager(context).getGlanceIds( { glanceId ->
updateAppWidgetState(context, glanceId) { prefs ->
prefs[stringPreferencesKey("article_title_key")] = articleTitle //new value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment