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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:47:40+00:00 2026-06-14T05:47:40+00:00

My app widget needs to be configured when it first added to the home

  • 0

My app widget needs to be configured when it first added to the home screen. I want to open a configuration view right after the user adds the widget.

AppWidgetProvider has no onCreated event, so I’m showing the confugration activity on the onUpdate event, and store a boolean value in SharedConfiguration that marks that the configuration has already been shown. Is there an easier way?

  • 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-14T05:47:41+00:00Added an answer on June 14, 2026 at 5:47 am

    In the AppWidgetProvider XML file there is an attribute called android:configure

    You can use this to point to an Activity to launch when the app is dropped onto the home screen. ex:

    <?xml version="1.0" encoding="utf-8"?>
    <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
        android:configure="com.bandsintown.WidgetSettingsActivity"
        android:minWidth="250dp"
        android:minHeight="110dp"
        android:minResizeWidth="180dp"
        android:minResizeHeight="110dp"
        android:resizeMode="vertical|horizontal"
        android:initialLayout="@layout/widget_layout"
        android:updatePeriodMillis="10000" />
    

    In your chosen configuration activity, the user can make whatever choice they want. You’ll need to grab and store the widget’s id. In the onCreate method, get the id like this:

    Intent intent = getIntent();
    Bundle extras = intent.getExtras();
    if (extras != null)
        mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
    

    When they’ve made their selection, use this to send a message back to your home screen widget that it is ready to be displayed:

    Intent intent = new Intent();
    intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
    setResult(RESULT_OK, intent);
    
    finish();
    

    That’ll get what you’re after.

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

Sidebar

Related Questions

I want to include a simple animation in my app where a view widget
I'm writing an App and an accopmanying widget that needs data. This data is
I want to design simple app widget which has two textview and two button
I have a view called DashboardView that instantiates multiple WidgetView s. Each widget needs
I need to turn a App / Widget Service off when a user isn't
I have a widget in my app that only needs to be updated when
I am new to android ,I want make an app which needs a progress
In my app I need to draw a widget contents onto Bitmap. The code(pseudo)
I have created an App Widget for Android 1.5. It uses a TextView to
I'm implementing a small web app widget that shows a legend/key for a diagram

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.