2

Everyone This is a question about how to creating a widget in my application. We all know how to add our widgets by customizing AppWidgetProvider. And the adding action is as follows:

System Menu -> Widget -> Widget Item(Our Widget Name)

However, what I want is to gain the same effects by just clicking one button, e.g. 'Add Widget', in my application. The first thought coming into my brain is to trigger a broadcast event of adding widget in the handler function of the 'Add Widget' button. But I don't how to trigger a broadcast event manually.

Guys, any ideas will be appreciated.

Wishes

Jhfu

machinarium
  • 631
  • 6
  • 17

2 Answers2

2

This is not supported by Android, sorry.

To be more specific, applications that are not home screens cannot add app widgets to home screens.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
1

Context.sendBroadcast(Intent intent)

techi.services
  • 8,473
  • 4
  • 39
  • 42