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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:37:23+00:00 2026-05-26T20:37:23+00:00

I just went through this tutorial: update-widget-in-onreceive-method (btw: would you propose any improvements to

  • 0

I just went through this tutorial:
update-widget-in-onreceive-method
(btw: would you propose any improvements to that code?)

At the end someone mentions:

I’m just wondering if there is a way to extend this further so that when the device is asleep (screen off), the updates stop. Then when the device wakes up, the updates resume.

So my question: is there a way of doing this? how?
or is the alarmmanager automatically stopped? – I don’t think so.

  • 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-26T20:37:24+00:00Added an answer on May 26, 2026 at 8:37 pm

    You can specify whether the device will wake up when scheduling the AlarmManager.

    Quote from the documentation:

    ELAPSED_REALTIME
    Alarm time in SystemClock.elapsedRealtime() (time
    since boot, including sleep). This alarm does not wake the device up; if it goes off while the device is asleep, it will not be delivered until the next time the device wakes up.

    ELAPSED_REALTIME_WAKEUP
    Alarm time in
    SystemClock.elapsedRealtime() (time since boot, including sleep),
    which will wake up the device when it goes off.

    Same goes for AlarmManager.RTC and AlarmManager.RTC_WAKEUP

    So you probably want one of the two AlarmManager.RTC or AlarmManager.ELAPSED_REALTIME. These continue while the device is awake and stop when the device is in standby. If this alarm is triggered while the device is asleep it will be delivered when the user turns the device back on though, exactly what you want. And no, the AlarmManagers scheduled alarms are not cancelled automatically in general.

    The part mentioned here can be found in this part of the tutorial, specific this line:

    alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), 20*1000, pendingIntent);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So just went through this tutorial: http://icodeblog.com/2010/04/05/ipad-programming-tutorial-hello-world/ Now what I want to do is
I just went through some MVC tutorials after checking this site out for a
I am learning asp.net mvc and went through a great tutorial that demonstrated it.
I went through this tutorial to create a MobileSubstrate addon. I could compile the
I just went through a bunch of stuff trying to figure out how to
Just as the title says. As i went through different explanations for choices made
I've just completed the very very nice django tutorial and it all went swimmingly.
I just wrote this into my WebForms .aspx: <span id=GenerateChartButton runat=server></span> I went to
I just went through the whole certificate/keychain/provisioning/appID/profile/DNA test process to get my app running
How can I verify an email address with codeigniter? I just went through 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.