Pablo
05/14/2025, 11:14 AMInfoPanel(
glanceModifier = glanceModifier.fillMaxSize().appWidgetBackground()
.clickable { actionStartActivity<MainActivity>() }
)
Is not working, and the log is printing this every time the widget is clicked:
app_time_stats: avg=3761.89ms min=3761.89ms max=3761.89ms count=1
logFgsApiBegin: FGS Logger Transaction failed, -129
No piid assigned for invalid/internal port id 15
mixer(0x7789f5d7f8e0) throttle end: throttle time(36)
Maybe someone know why actionStartActivity doesn't work?Pearce Keesling
05/14/2025, 2:39 PMactionStartActivity
I think it returns a function that you should pass into clickable. I had a similar problem recently and I think that was what happened to us. (On mobile so sorry if my memory is bad)Chrimaeon
05/14/2025, 4:24 PMPablo
05/14/2025, 4:27 PMPablo
05/14/2025, 4:30 PMPearce Keesling
05/14/2025, 4:32 PMbbade_
05/20/2025, 9:34 PMpublic fun GlanceModifier.clickable(onClick: Action): GlanceModifier =
this.then(ActionModifier(onClick))
Lambdas do cause composition to rerun, which is good when you want to update the internal state of your app and produce a new ui state for your widget. This is good if you need to kick off a refresh, save something to persistence, etc without starting an activity. Activities should not be started from lambdas.
Lambdas are handled like this
@Composable
public fun GlanceModifier.clickable(block: () -> Unit): GlanceModifier =
this.then(ActionModifier(action(block = block)))