0

I am trying to get the list of provider info for all the widgets, presented in the device from my application. The code snippet is given below:

AppWidgetManager manager = AppWidgetManager.getInstance(context);
List<AppWidgetProviderInfo> infoList = manager.getInstalledProviders();

I have 26 widgets present in my device and it gives list with only 15 widgets' provider info. But as the definition of getInstalledProviders() says, it returns a list of the AppWidget providers that are currently installed. In case if it gives provider info for only installed appwidgets, then how can i get the complete list of AppWidget provider in the device?

0x49D1
  • 8,505
  • 11
  • 76
  • 127
J.D
  • 11
  • 2
  • How to get the list of all AppWidgetProvider present in the device not only the installed ones? – J.D Jul 22 '16 at 06:10
  • AppWidgetManager manager = AppWidgetManager.getInstance(context); List infoList = manager.getInstalledProviders(); for (AppWidgetProviderInfo info : infoList) { String providerInfo = "" + info.provider; int startIndex = providerInfo.indexOf('{'); int endIndex = providerInfo.indexOf('}'); String[] parts = (providerInfo.substring(startIndex + 1, endIndex)).split("/"); String packageName = parts[0]; String widgetProviderName = parts[1]; – J.D Jul 22 '16 at 06:12
  • the code snippet which iam using to get the list of Appwidget provider info,. – J.D Jul 22 '16 at 06:14

0 Answers0