4

How to get list of widgets & shortcuts of homescreen in android. Here is my code:

List<AppWidgetProviderInfo> infos = mAppWidgetManager.getInstalledProviders();

        for (int i = 0; i < infos.size(); i++) {
            int ids[] = mAppWidgetManager.getAppWidgetIds(infos.get(i).provider);
            if (ids.length != 0) {
                Log.d("TAG", "Found non-zero-length provider!");
                id = ids[0];
                info = infos.get(i);
                break;
            }
        }
Tim
  • 35,413
  • 11
  • 95
  • 121
  • I don't know that you would be able to do this across the board, what with different launchers on every phone. You can probably get a list of every app in the app tray, and every widget on the phone, but I imagine that getting all of the shortcuts and widgets that a launcher is using will vary from launcher to launcher. – boztalay Oct 04 '12 at 17:11
  • @user1719743 did you find any solution for your question as i also want this for my app. – Chirag Shah Sep 07 '13 at 06:39
  • @Chriag-Shaha: I also would like to have the solution, try +1 the question, maybe it gets some attention! – Sdra Dec 19 '13 at 10:53

0 Answers0