Skip to content

Instantly share code, notes, and snippets.

Created May 30, 2022
What would you like to do?
When Jetpack's Glance met his fellow worker, Work Manager
class MyWidget() : GlanceAppWidget() {
override val stateDefinition = PreferencesGlanceStateDefinition
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