我最新的想法是使用
updateAppWidgetState(context = context, definition = PreferencesGlanceStateDefinition, glanceId = glanceId) {
// ...
}
Run Code Online (Sandbox Code Playgroud)
和
GlanceWidget().update(context = context, glanceId = glanceId)
Run Code Online (Sandbox Code Playgroud)
但我无权访问glanceId。
问题的背景是我想将 uid 添加到 AppWidgetState,如本问题所述:How to get the AppWidgetId of a Compose Glance widget?
我怎样才能获得glanceId(例如,从我在配置活动中有权访问的appWidgetId)或者我该如何实现这一点?
android-widget android-jetpack-compose glance glance-appwidget