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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:48:18+00:00 2026-06-16T00:48:18+00:00

I am trying to make a widget, where its update frequency can be defined

  • 0

I am trying to make a widget, where its update frequency can be defined by user and changed at runtime. I can do that using alarm manager, however, is there a way to change the interval of the alarm once its set?

If not, I can still cancel it and start it again with new interval, however I dont know how will this work because widget might not even be added to the homescreen, so the question is, is there a way to know if an alarm is running or better, widget is on homescreen?

Thanks

// EDIT
How to determine if your widget exists

private boolean widgetExists() {
    ComponentName myWidget = new ComponentName(this, MyWidgetProvider.class);
    int[] ids = AppWidgetManager.getInstance(this).getAppWidgetIds(myWidget);
    return ids.length > 0;
}
  • 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-16T00:48:19+00:00Added an answer on June 16, 2026 at 12:48 am

    is there a way to change the interval of the alarm once its set?

    For this one, we can reference the docs for AlarmManager.setRepeating():

    Schedule a repeating alarm… If there is already an alarm scheduled for the same IntentSender, it will first be canceled.

    In other words, setting an alarm with the same type cancels the existing interval and resets the alarm with the new values.


    is there a way to know if an alarm is running or better, widget is on homescreen?

    This is the job of AppWidgetProvider. The callbacks in your provider (onEnabled, onUpdate, etc.) can be used to determine the state of whether any widgets are actually active (AppWidgetProvider docs).

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

Sidebar

Related Questions

I'm trying to make a widget that selects an area in the page using
I'm trying to make a widget used for controlled time entry that uses up
I'm new in all widget staff so I'm trying to make one simple that
I am trying to make a custom Gallery widget. I found that I wanted
I have a form that makes widgets, if a user is trying to make
I am trying to make a program in Tkinter that requires the entry widget
I'm using Ruby Qt bindings. I'm trying to make a square widget (checker board),
I'm trying to make a Google Maps widget for my website but all of
I am trying to make a group activity with the radio widget. My problem
I'm trying to make video output (sequence of frames) to any qt visible widget.

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.