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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:58:06+00:00 2026-05-19T01:58:06+00:00

This is how I configure my APP’s widget: <appwidget-provider xmlns:android=http://schemas.android.com/apk/res/android android:minWidth=240dp android:minHeight=193dp android:updatePeriodMillis=86400000 android:initialLayout=@layout/xyz_appwidget

  • 0

This is how I configure my APP’s widget:

<appwidget-provider
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:minWidth="240dp"
    android:minHeight="193dp"
    android:updatePeriodMillis="86400000"
    android:initialLayout="@layout/xyz_appwidget"
    android:configure="com.xyz.activity.Configuration"
    />

Therefore, the system will bring up the Configuration activity, once the widget has been put on the homescreen by the user. Unfortunately, without the configuration applied, this widget should not be put on the screen.

I added some debugging output. This happens when the user is selecting the widget for his homescreen. Note: This is when the Configuration activity is in front, NOT the widget.

I/ActivityManager(  101): Start proc com.xyz for broadcast com.xyz/.widget.xyz.XyzWidgetProvider: pid=14371 uid=10050 gids={3003, 1015}
D/XyzWidgetProvider(14371): onReceive: android.appwidget.action.APPWIDGET_ENABLED
D/XyzWidgetProvider(14371): onEnabled
D/XyzWidgetProvider(14371): onReceive: android.appwidget.action.APPWIDGET_UPDATE

So that means even the widget is not configured, both events (ENABLED, UPDATE) will be fired. Enabled makes sense to me, but UPDATE clearly not. Especially when the Configuration activity finished successfully, no additional UPDATE event is being sent.

I also read that by setting the result of the Configuration activity to Activity.RESULT_CANCELED, one is able to cancel the configuration process. But as this clearly runs asynchronous I don’t know how to make the configuration process blocking? Anyone encountered this before?

My final note: I had a look in the Android Gallery Widget, which somehow manages this properly, so a non-configured gallery widget will not be added. But I suspect some HTC magic there as the logs are not very helpful.

  • 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-19T01:58:06+00:00Added an answer on May 19, 2026 at 1:58 am

    Here is how you handle this:
    In your configuration activity, do this in your onCreate():
    setResult(Activity.RESULT_CANCELED);

    Once the configuration activity is done, e.g. all parameters are set and widget should be shown, do
    setResult(Activity.RESULT_OK);

    So, if the user does not finish the configuration activity, your widget is removed.

    However, in the widget code itself (onUpdate), you still need to check whether configuration is complete, because APPWIDGET_UPDATE will definitely be called before configuration completion. You can just skip all updating altogether if configuration is not there, your widget will not be visible at this point anyway, and once configuration is complete, your widget is either removed by the system or its configuration is there.

    One more thing. You need to initiate widget update from your configuration activity upon successful completion, because the system will not do it by itself.

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

Sidebar

Related Questions

A Facebook app is hosted on my server at, say, http://server.com/projects/fbapp/ , but is
I am looking at this boot.rb file: http://github.com/bestbuyremix/BBYIDX/blob/master/config/boot.rb And after trying to understand it,
I'm running autoconf and configure sets SHELL to '/bin/sh'. This creates huge problems. How
This past summer I was developing a basic ASP.NET/SQL Server CRUD app, and unit
I want to configure my app to use a different schema than the default
I have a WCF client/server app which is communicating over HTTP using the WSHttpBinding.
A lot of my users keep going to http://(rails app URL)/blog , but I
I want to configure my webstart app/jnlp so that if no internet connection is
I'm working on an auto-configure app for new PC's. I managed to programatically set
I'm making an activity to configure my app, and I have to divide the

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.