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
class MyWidget() : GlanceAppWidget() {
override val stateDefinition = PreferencesGlanceStateDefinition
@Composable
override fun Content() {
val state = currentState<Preferences>()
val articleTitle = state[stringPreferencesKey("article_title_key")] ?: ""
Text(text = articletitle)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment