0

I know that it's not possible to place an app widget programatically on the homescreen - the user has to do it by himself. But is there a way, to let the user create an app widget without having to go to the "widgets-tab" and choosing it from the list of all available widgets?

My idea is to have a Button in my Activity, which provides some kind of shortcut to that list . This way the user still would create it by himself, but he wouldn't have to leave the app. Is there an Intent I could use in combination with startActivityForResult()?

wodzu
  • 3,004
  • 3
  • 25
  • 41

2 Answers2

1

Have a look at CommonsWare answer here:

Add widget to homescreen from Android application

You can bring the list up put you are unable to select a widget and install it for that your app must be an appWidgetHost

Community
  • 1
  • 1
D.Bish
  • 208
  • 1
  • 6
0

In Android O, its possible to pin app widget programmatically. Just watch at example here

Also check out Google official documentation

Jose Gómez
  • 3,110
  • 2
  • 32
  • 54