File tree Expand file tree Collapse file tree
HTTPShortcuts/app/src/main/kotlin/ch/rmy/android/http_shortcuts/activities/main Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -420,8 +420,10 @@ class MainActivity : BaseComposeActivity() {
420420 fun determineMode (context : Context , intent : Intent ) = when (intent.action) {
421421 Intent .ACTION_CREATE_SHORTCUT -> SelectionMode .HOME_SCREEN_SHORTCUT_PLACEMENT
422422 AppWidgetManager .ACTION_APPWIDGET_CONFIGURE -> {
423+ val widgetId = intent.getIntExtra(AppWidgetManager .EXTRA_APPWIDGET_ID , 0 )
424+ logInfo(" Determining mode for widget configuration, has Widget ID = ${widgetId > 0 } " )
423425 val variableLayout = AppWidgetManager .getInstance(context)
424- .getAppWidgetInfo(intent.getIntExtra( AppWidgetManager . EXTRA_APPWIDGET_ID , 0 ) )
426+ .getAppWidgetInfo(widgetId )
425427 ?.initialLayout
426428 when (variableLayout) {
427429 R .layout.variable_widget -> SelectionMode .VARIABLE_WIDGET_PLACEMENT
You can’t perform that action at this time.
0 commit comments