Karakuri
Karakuri

Reputation: 38605

Get list of AppWidgetProviders in my app's package

Is there an easy way to get a list of AppWidgetProviders that are in my app's package? I want to iterate over them and inspect some data from their corresponding AppWidgetProviderInfo objects at runtime.

Upvotes: 1

Views: 165

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007658

Call getInstalledProviders() on the AppWidgetManager, iterate over the list, and pay attention to those whose AppWidgetProviderInfo provider ComponentName is for your package.

Upvotes: 1

Related Questions