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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:21:26+00:00 2026-05-30T11:21:26+00:00

As I know there are two types of calling AppWidgetProvider’s onUpdate() method: when updatePeriodMillis

  • 0

As I know there are two types of calling AppWidgetProvider’s onUpdate() method:

  1. when updatePeriodMillis circle is expired
  2. when new widget is added to homescreen

In onUpdate() method, I want to start some service in first case, but won’t in second. Is it possible to determine of how onUpdate() was called?

  • 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-30T11:21:28+00:00Added an answer on May 30, 2026 at 11:21 am

    I think there is no easy flag that’s been supplied to you in the update broadcast which indicates either situation.

    Keep in mind though that every ACTION_APPWIDGET_UPDATE broadcast (and therefore every onUpdate() call) contains all or a subset of the appwidget IDs for update purposes. These IDs are constant over the lifecycle of a widget, each has the same ID until it gets deleted.

    Which means that you can store your IDs and compare them every time you get an onUpdate() call. If you hit an onUpdate() with an ID in the supplied array that’s not in your saved records, you can be sure that this is a new widget instance beeing updated. Otherwise it’s one or more of the old ones.

    To keep your records tidy, you have to implement onDeleted() in your provider too. Remove the deleted IDs from your records. Otherwise you can run into issues when the user removes a widget and adds a new instance, it might get the same ID.

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

Sidebar

Related Questions

I know there are two types of buffer: front and back buffer . I
To start, I know there are two kinds of JSON serialization currently built into
I'd like to know whether there is a way to compare two objects in
I would like to know if there is anyway I can compare two columns
I'd like to know if there's a difference between the following two calls to
I know that PHP4 is dead, however there are about two dozen or so
I have two keyboards connected to my PC, is there any way to know
I have a users table where there are two types of users in it,
I've seen that history.go() method can have two types of parameter: see: http://www.w3schools.com/jsref/met_his_go.asp But
I wish to know all the pros and cons about using these two methods.

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.