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 7028183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:21:12+00:00 2026-05-28T00:21:12+00:00

My app has supports multiple size widgets per the scheme outlined here how to

  • 0

My app has supports multiple size widgets per the scheme outlined here how to add multiple widgets in one app?

It has a single abstract BaseWidgetProvider class that handle all the widgets. It is then subclassed by empty WidgetProvider1/2/3/4 classes (one per size) that are listed in the Android Manifest and everything works just fine. The registration in the manifest looks like this (typical for 1..4)

<receiver
    android:name=".widget.MyWidgetProvider4"
    android:label="My Widget size 4" >
    <intent-filter>
        <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
    </intent-filter>
    <intent-filter>
        <action  
            android:name="my.domain.BaseWidgetProvider.UPDATE_WIDGET" />
    </intent-filter>
    <meta-data
        android:name="android.appwidget.provider"
        android:resource="@xml/my_widget_info4" />
    </receiver>

My question is about sending an intent from the app to update the widgets with new data. I could not find a way to send a single intent for all 4 providers and am currently sending 4 seperate intents each time

for (Class cls : BaseWidgetProvider.WIDGET_PROVIDER_CLASSES) {
   Intent intent = new Intent(mApp.context(), cls);
   intent.setAction(BaseWidgetProvider.UPDATE_WIDGET);
       this.sendBroadcast(intent);
}

where

public static final Class[] WIDGET_PROVIDER_CLASSES = new Class[] {
    WidgetProvider4.class,
    WidgetProvider1.class,
    WidgetProvider2.class,
    WidgetProvider3.class      
};
  1. Is this the best way to send an update intent to all widget sizes (note that typically the user has only zero or one widgets)?

  2. Is there a reasonable way to send only a single intent?

  3. Is there a way to have a single receiver that will update widget instances of all four sizes?

Note that the base provider class does not care about the widget size and does exactly the same for all sizes. The only difference is the initial widget size on the user’s screen. If the user resizes the widget (e.g. using Launcher Pro), it works just fine.

  • 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-05-28T00:21:13+00:00Added an answer on May 28, 2026 at 12:21 am

    Add an intent filter with one intent action into the declarations of all of your widget providers in Manifest file, e.g.:

       <intent-filter>
            <action android:name="my.domain.blablabla.MY_SUPER_INTENT_TO_UPDATE_ALL" />
        </intent-filter>
    

    And then just send this intent from your application as broadcast.
    In this case the intent will be handled by all your widget providers.

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

Sidebar

Related Questions

I'm writing a web app that supports multiple users. Each user has their own
I have a web app built with html5 boilerplate that has multiple skins available.
Background: App has a shake to go home feature. Home view Only supports portrait.
I'm trying to support multiple databases for an app that I'm writing. The app
I know this question has been asked here a few times before. But i
I want to have one model & view that is served by multiple controllers
I'm writing an iPhone app that (like most apps) supports auto-rotation: You rotate your
I'm developing an iPhone/iPad app that supports dragging items between table views. Since all
My app needs to pull data from MULTIPLE sources. The following needs to be
I have a view in my app that has three segmentedButtonControllers and I designed

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.