Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8513035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:26:38+00:00 2026-06-11T04:26:38+00:00

I need to find any AppWidget id to test some features. The code to

  • 0

I need to find any AppWidget id to test some features. The code to do this:

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;
            }
        }

But ids[] length is always 0! Why and how to fix it?

Update: I have added this line to the loop’s beginning:

Log.d("TAG", provider.getPackageName() + "; " + provider.getClassName());

And it prints:

D/TAG     ( 5686): Providers count: 12
D/TAG     ( 5686): com.andrew.apollo; com.andrew.apollo.app.widgets.AppWidget11
D/TAG     ( 5686): com.andrew.apollo; com.andrew.apollo.app.widgets.AppWidget41
D/TAG     ( 5686): com.andrew.apollo; com.andrew.apollo.app.widgets.AppWidget42
D/TAG     ( 5686): com.android.browser; com.android.browser.widget.BookmarkThumbnailWidgetProvider
D/TAG     ( 5686): com.android.calendar; com.android.calendar.widget.CalendarAppWidgetProvider
D/TAG     ( 5686): com.android.contacts; com.android.contacts.socialwidget.SocialWidgetProvider
D/TAG     ( 5686): com.android.deskclock; com.android.alarmclock.AnalogAppWidgetProvider
D/TAG     ( 5686): com.android.email; com.android.email.provider.WidgetProvider
D/TAG     ( 5686): com.android.gallery3d; com.android.gallery3d.gadget.PhotoAppWidgetProvider
D/TAG     ( 5686): com.android.quicksearchbox; com.android.quicksearchbox.SearchWidgetProvider
D/TAG     ( 5686): com.android.settings; com.android.settings.widget.SettingsAppWidgetProvider
D/TAG     ( 5686): com.android.vending; com.android.vending.MarketWidgetProvider

So, it seems to be OK, but I still can’t get id’s of this widgets.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:26:40+00:00Added an answer on June 11, 2026 at 4:26 am

    Make sure that ComponentName you use to get AppWidgetManager matches the widget provider in the manifest. If it doesn’t, you’ll get an empty list (ids.length = 0, the loop won’t execute).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dont worry we dont need to find out any bug in this code. Its
I can't find any PHP script to compute Krippendorff's Alpha . I need this
I just need to secure my WF services. Can't find any resources on this.
Need to take a SELECT drop down list options and find if any of
i cannot find any way to execute this - all i need is to
I need a fastest way to find any point inside triangle(not edges) in 2D.
Everywhere I see, can't find any info about it. I need that people who
I need to Find Previous month name using Calender or any classes that in
So, I need to find out the highest possible difference between any two random
Weird question, but i need to find an answer. Is there any way, in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.