StartActivityForResult call window killed before returning result

I have a launcher app that is trying to add widgets. Most of them work fine, but if you have a settings screen, the widget is never added. Launcher causes

REQUEST_PICK_APPWIDGET = 9 Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK); pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); startActivityForResult(pickIntent, REQUEST_PICK_APPWIDGET); 

and configure activity is running, but as it appears I see it in lolcat

 W/WindowManager( 2096): Rebuild removed 7 windows but added 6 W/WindowManager( 2096): This window was lost: Window{42abf130 com.android.settings/com.android.settings.AppWidgetPickActivity paused=false} 

The configuration completes and nothing happens because the appwidgetpicker is already dead.

The launcher never works, theres never anything bad happens, just nothing happens. This is not the application itself that is crashing, its systemappwindgetpicker afaik.

+4
source share
2 answers

https://github.com/T3hh4xx0r/Hax-Launcher/commit/4b6d2d99fdef0ded0684688a2ac5ddeb2faa9f1d

Somewhere along the line, the variable became invalid. I just made a backup to prevent this.

+2
source
+3
source

Source: https://habr.com/ru/post/1442246/


All Articles