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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:01:40+00:00 2026-06-12T11:01:40+00:00

Scenario 1: Device is loaded I add first widget OneX -> Calls onEnabled |

  • 0

Scenario 1:

  1. Device is loaded
  2. I add first widget
  3. OneX -> Calls onEnabled | Galaxy Tab -> doesnt call onEnabled.

Scenario 2:

  1. Device is booted with widget already on screen.
  2. OneX -> Calls onEnabled | Galaxy Tab -> Calls onEnabled

But It must be called when user places one on screen (scenario 1), else whats the point. Surely you dont have to restart your device to get onEnabled called.

Its important, because I Attach a alarm manager to update my widget every 2 seconds:

    AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);

    Calendar calendar = Calendar.getInstance();
    calendar.setTimeInMillis(System.currentTimeMillis());
    calendar.add(Calendar.SECOND, 1);
    alarmManager.setRepeating(AlarmManager.RTC, calendar.getTimeInMillis(), 1000, createClockTickIntent(context));

There is a similar question with no working solution: AppWidgetProvider: not called onEnabled method

There is no need to register these intents, and doing so doesnt help anyway.

My question is why is onEnabled not invoking, and how do I get it to.

It says on google Docs: ACTION_APPWIDGET_ENABLED:

Sent when an instance of an AppWidget is added to a host for the first
time. This broadcast is sent at boot time if there is a AppWidgetHost
installed with an instance for this provider.

Basically confirming that it should work in both scenarios

This is the intent that triggers onEnabled()

Called in response to the ACTION_APPWIDGET_ENABLED broadcast when the
a AppWidget for this provider is instantiated. Override this method to
implement your own AppWidget functionality.

The fact it works on the phone, and not the tablet, is strange. Is it an issue with android 3.2 and is there a work around?

  • 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-12T11:01:42+00:00Added an answer on June 12, 2026 at 11:01 am

    After lots of attempt to find why it is acting this way, I came up short.

    It is either an android related problem or a device related problem, where the widget enabled broadcast is never sent.

    The only work around to get the widget updating with alarm manager, was to initalise the alarm manager from its own method, and then call that from onEnabled AND onUpdate. So when it falls short of onEnabled, it will be covered by onUpdate, when the widget goes to update itself (on app call to it). And in the scenario onEnabled does work, it will just replace the existing alarm manager with a new instance when ever onUpdate is called.

    Maybe not the ideal solution depending on what you are trying to do in onEnabled, but the only one I could find.

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

Sidebar

Related Questions

There is a scenario where an application tells a device on a network to
Scenario first :- I'm using Entity Framework to do some queries, to build my
Similar question here: jQueryMobile, Phonegap and Device Token - iOS The scenario is, I
Let's assume the following scenario: Person A: calls person B. Person B with an
my scenario: I have a device which can send an SMS by error with
This is my scenario: I have a remote service (local to the Android device
.Net Compact Framework Scenario: User is on a screen. Device can't finds a printer
I'm looking to replicate the Add a device dialog (I can't attach a picture
Working scenario: When I run my app from xcode directly to my device I
I need to get the device's current geographical location. Scenario : if I am

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.