Function

updateAppWidgetState

Update the state of an app widget.

updateAppWidgetState

Source set: Android
public suspend fun <T> updateAppWidgetState(
    context: Context,
    definition: GlanceStateDefinition<T>,
    glanceId: GlanceId,
    updateState: suspend (T) -> T,
): T

Update the state of an app widget.

The state definition must be the one used for that particular app widget.

updateAppWidgetState

Source set: Android
public suspend fun updateAppWidgetState(
    context: Context,
    glanceId: GlanceId,
    updateState: suspend (MutablePreferences) -> Unit,
)

Update the state of an app widget using the global PreferencesGlanceStateDefinition.

The state definition must be the one used for that particular app widget.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: