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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:05:34+00:00 2026-06-15T18:05:34+00:00

AlarmManager does not start my broadcast receiver when phone is locked for example. I

  • 0

AlarmManager does not start my broadcast receiver when phone is locked for example. I search and try many solutions but none works:

 AlarmManager mgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
      Intent i = new Intent(context, OnAlarmReceiver.class);
      PendingIntent pi=PendingIntent.getBroadcast(context, 0, i, 0);

      mgr.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                        SystemClock.elapsedRealtime()+60000,
                        PERIOD,
                        pi);

but OnAlarmReceiver is never fired!

I also try with WakeLock:

@Override
    public void onReceive(Context context, Intent intent) {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
        PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "");
        wl.acquire();
// code
wl.release();
 }

but also not working. why?

  • 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-15T18:05:35+00:00Added an answer on June 15, 2026 at 6:05 pm

    but OnAlarmReceiver is never fired!

    It should be. Here is a sample project showing a similar use of AlarmManager that works perfectly fine when the screen is off and the phone is locked. In my sample, the “real work” is done by a WakefulIntentService, by means of a BroadcastReceiver, so the BroadcastReceiver is definitely getting control.

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

Sidebar

Related Questions

I have been trying to set AlarmManager for Specific date, but it is not
Take the Gmail app as an example. Whether the phone is on or not,
My AlarmManager does not work properly. The LogCat says that setting alarm to turn
I'm trying to start a service using Alarmmanager with pendingIntent. I stuck with Unable
I get my Broadcast receiver to set a recurring alarm, to fire up a
I'm building an alarm clock app in Android. Does AlarmManager automatically handle clock changes
I have code, and it just does not work, so I ask anyone to
I have the following broadcast reciever that gets called when the phone boots up
My app needs to execute a specific task every hour. It does not matter
I have a problem with the android alarmmanager. I'm setting the alarmmanager with two

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.