Reputation: 1189
I use the following code to return all available (installed) widgets. But it doesn't return all of them. In my case, it returns 47 widgets, while the stock launcher has 73 widgets.
AppWidgetManager mAppWidgetManager = AppWidgetManager.getInstance(getApplicationContext());
List<AppWidgetProviderInfo> infoList = mAppWidgetManager.getInstalledProviders();
for (AppWidgetProviderInfo info : infoList) {
}
Upvotes: 1
Views: 341
Reputation: 1189
Thanks to @CommonsWare's assistance, these extras are not widgets, they are shortcuts to activities that are fetched using the following code.
Intent shortcutsIntent = new Intent(Intent.ACTION_CREATE_SHORTCUT);
List<ResolveInfo> shortcuts = getPackageManager().queryIntentActivities(shortcutsIntent, 0);
Upvotes: 2