fixed crash when opening app from widget
This commit is contained in:
parent
f4d2fa6089
commit
dcc91cf5a3
1 changed files with 7 additions and 8 deletions
|
@ -41,16 +41,15 @@ class HomeWidgetProvider : AppWidgetProvider() {
|
|||
for (widgetId in appWidgetIds) {
|
||||
val widgetInfo = appWidgetManager.getAppWidgetOptions(widgetId)
|
||||
|
||||
goAsync().run {
|
||||
defaultScope.launch {
|
||||
val pendingResult = goAsync()
|
||||
defaultScope.launch() {
|
||||
val backgroundProps = getProps(context, widgetId, widgetInfo, drawEntryImage = false)
|
||||
updateWidgetImage(context, appWidgetManager, widgetId, backgroundProps)
|
||||
|
||||
val imageProps = getProps(context, widgetId, widgetInfo, drawEntryImage = true, reuseEntry = false)
|
||||
updateWidgetImage(context, appWidgetManager, widgetId, imageProps)
|
||||
|
||||
finish()
|
||||
}
|
||||
pendingResult?.finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue