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

  • Home
  • SEARCH
  • 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 7595965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:48:16+00:00 2026-05-30T21:48:16+00:00

I have built a android widget that allows for multiple sizes 2×2 and 4×2.

  • 0

I have built a android widget that allows for multiple sizes 2×2 and 4×2. So when someone is on the widget picker screen they see both sizes. They click on one of the sizes and it goes to my configuration activity. How do I know what size they picked on the widget picker screen. I need to know which one was chosen on the configuration activity. I am having trouble of how to move forward and what direction to look into. Below is my manifest file just in case you think it might clarify what I am doing:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.corradodev.customizable_countdown_widget"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="3" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name">
        <!-- Configure Activity -->
        <activity android:name=".configure">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>
        <!-- Broadcast Receivers that will process AppWidget updates -->
        <receiver android:name=".customizable_countdown_widget_large" android:label="@string/app_name_large">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
            <meta-data android:name="android.appwidget.provider" 
                       android:resource="@xml/widget_provider_large" />
        </receiver>
        <receiver android:name=".customizable_countdown_widget_small" android:label="@string/app_name_small">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
            <meta-data android:name="android.appwidget.provider" 
                       android:resource="@xml/widget_provider_small" />
        </receiver>
         <!-- Service for updating -->
        <service android:name=".widget_service" />

    </application>
</manifest>

Thanks for any help.

Solution:
In the oncreate of the configure activity

   Bundle mExtras = mIntent.getExtras();
if (mExtras != null) {
    mAppWidgetId = mExtras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
}
//Log.d(TAG, Integer.toString(mAppWidgetId));

// If they gave us an intent without the widget id, close
if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) {
    finish();
}
AppWidgetProviderInfo providerInfo = AppWidgetManager.getInstance(getBaseContext()).getAppWidgetInfo(mAppWidgetId);
String minWidth=String.valueOf(providerInfo.minWidth);
  • 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-30T21:48:17+00:00Added an answer on May 30, 2026 at 9:48 pm

    You could probably use AppWidgetProviderInfo AppWidgetManager.getAppWidgetInfo(int appWidgetId) and check `minSize’, etc. once you have the wdiget ID. You can get it from the config activity like this:

    int id = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,
                        AppWidgetManager.INVALID_APPWIDGET_ID);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a stackview widget for home Screen but i dont know how
I have an app that's built for Android 2.2, so I'm not using the
I have recently built an application that shows you a camera preview on screen.
I am using ANT to compile an Android app that I have built. It
I have Android pet-project DroidIn which utilizes HttpClient 4 (built into Android) to do
I want to build an notepad-style application on android that will have syntax highlighting.
I have built an MSI that I would like to deploy, and update frequently.
I have built an application in C# that I would like to be optimized
I have built a .dll under WinXP that claims it can't find DWMAPI.DLL when
I have built a MS Access 2007 application that can create reports files 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.