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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:40:39+00:00 2026-05-23T19:40:39+00:00

Im currently working on creating some appwidgets for my application; one of those is

  • 0

Im currently working on creating some appwidgets for my application; one of those is a widget containing a clock which needs an update every 60 seconds. I therefore create an alarm in the onEnabled() function of the AppWidgetProvider which sends a clock update intent every 60 seconds, which is received by the appwidgetprovider; this works like a charm, however id like to get rid of the timer when there are no more clock widgets as i like to keep things tidy. I therefore remove the alarm in the onDisabled() function of the AppWidgetProvider, as that one is called when the last of the widget type is removed.

The problem however is that even when I remove the last of the widgets, there are still widgetIds remaining in the appwidgetmanager and thus onDisabled() is never called. I tried rebooting the device, but they seem to persist.

Is this common behaviour and should i not rely on onDisabled() being called, is this a bug, or am i doing something terribly wrong?

  • 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-23T19:40:39+00:00Added an answer on May 23, 2026 at 7:40 pm

    Up to and including Android 1.6 widgets which fail to get added to the home screen are still in the list. I call them “phantom widgets”. They get created when you try to add a widget but there’s not enough space and you will get a message about that. But the widget somehow still makes it to the internal list. I think this was supposed to be fixed with 2.0 but I’m not sure.

    In addition to that, using only onEnabled and onDisabled is a very bad idea for your purpose. Even when the screen is switched off your widgets will continue to get updated. Your device will never really sleep and the battery will drain too quickly. At least add a Receiver for ScreenOn and ScreenOff!

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

Sidebar

Related Questions

I am currently working on the WPF project which involves creating a touch-screen application
I am currently working on a .Net application which makes HTTP requests to some
I'm currently working on a project which needs some server-client communication. We're planning to
I'm currently working on creating a private messaging system, (PHP/MySQL) in which users can
Hey guys... I'm working on creating one of my first websites and currently have
I'm working on an application which stores some preferences globally, for all users. It
I'm currently creating a process for our business which takes some data from a
Currently working on a VBScript to automate some of the dirty PST ingestion work
Am currently working on an application that requires users to submit posts and comments
Im currently working with an API which requires we send our collection details 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.