2

I have found examples here: Android - Intent that open widget context menu and here: http://coderender.blogspot.com/.

The first one launches the widget picker, but goes it goes away when you select anything. The second one lets you pick a widget, but it shows it in the application view. Is there a way to call the widget selection from a button in an app but still have the main screen on the phone be the AppWidgetHost?

It may be me misinterpreting things, but it looks to me like the AppWidgetHost has to be the application where you are calling the widget selection menu.

Community
  • 1
  • 1
Jasonwilliams10
  • 292
  • 1
  • 4
  • 17

1 Answers1

5

Is there a way to call the widget selection from a button in an app but still have the main screen on the phone be the AppWidgetHost?

Only if you are the home screen.

It may be me misinterpreting things, but it looks to me like the AppWidgetHost has to be the application where you are calling the widget selection menu.

More importantly, it is the AppWidgetHost that must do the work to make use of the selection.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • I tried doing it, I still see the same behavior, is there no updates on the latest android release? – SwiftParser Jun 11 '15 at 11:30
  • @SwiftParser: "I tried doing it" -- I do not know what "it" is. "I still see the same behavior" -- I do not know what behavior you are referring to. "is there no updates on the latest android release" -- I am not aware of any recent changes to `AppWidgetHost`, but since very few developers have a need for it, I do not pay much attention to it. – CommonsWare Jun 11 '15 at 11:33
  • I am trying to invoke a widget on home screen from my app. I am able to get the Widget Picker dialogue, but nothing happens when I click on a widget. – SwiftParser Jun 11 '15 at 11:37
  • @SwiftParser: Unless you are the home screen, or otherwise implement an `AppWidgetHost`, the widget picker dialog is useless. – CommonsWare Jun 11 '15 at 11:41
  • @CommonsWare Thank you so much. – SwiftParser Jun 15 '15 at 08:55