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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:32:27+00:00 2026-06-17T18:32:27+00:00

I’m setting multiple alarms so they can be repeated on specific days. Now I

  • 0

I’m setting multiple alarms so they can be repeated on specific days. Now I have heard that Android doesn’t save the alarms on reboot. I have also read that BroadcastReceiver should be used when BOOT_COMPLETED to reschedule all the alarms.

But how do I tell the BroadcastReceiver to reschedule alarms after reboot if I have 5 alarms per day = around 35 alarms scheduled on different days. Do I need to store them in the database or? How do I store them? Or is the BOOT_COMPLETED all I need? Is there any example for this kind of thing? I couldn’t find it.

This is what I currently have for setting the alarms and my simple receiver class. I’m using Service instead of BroadcastReceiver here because I have heard that BR should be used to only process short things and in the future I’ll have to use some long sound clips.

   private void setAlarm(){     
            Intent intent = new Intent(getBaseContext(), AlarmReceiver.class);
            PendingIntent pendingintent = PendingIntent.getService(getBaseContext(), 2, intent, PendingIntent.FLAG_CANCEL_CURRENT);

            AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
            am.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + sveskupa, pendingintent);
            Toast.makeText(getBaseContext(), "Alarm is set", Toast.LENGTH_LONG).show();
        }

AlarmReceiver class:

public class AlarmReceiver extends Service{

            @Override
            public IBinder onBind(Intent intent) {
                // TODO Auto-generated method stub
                return null;
            }

            @Override
            public void onCreate() {
                // TODO Auto-generated method stub
                super.onCreate();
                final MediaPlayer MPRadio1 = MediaPlayer.create(this, R.raw.radio3);
                MPRadio1.start();
                Toast.makeText(getBaseContext(), "OnCreate", Toast.LENGTH_LONG).show();

            }        
  • 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-17T18:32:29+00:00Added an answer on June 17, 2026 at 6:32 pm

    But how do I tell the BroadcastReceiver to reschedule alarms after reboot if I have 5 alarms per day = around 35 alarms scheduled on different days.

    Either the alarm schedule is fixed, unchanging, and baked into your code, or it is not.

    If it is baked into your code, just use that same code from your boot-time BroadcastReceiver to re-establish the alarm schedule.

    Otherwise, the alarm schedule is coming from somewhere, as the alarm schedule is unlikely to have spontaneously been created due to the interaction of cosmic rays with the CPU and memory of the phone. You need to ensure that you have access to that same information after a reboot.

    Do I need to store them in the database or? How do I store them?

    That is up to you.

    I’m using Service instead of BroadcastReceiver here because I have heard that BR should be used to only process short things and in the future I’ll have to use some long sound clips.

    Do not use a Service directly from a _WAKEUP-style alarm, as there is no guarantee that your Service will ever get control. Either do not use a _WAKEUP-style alarm, or have the alarm trigger a BroadcastReceiver, which can work with a WakeLock to ensure that your Service gets control and can complete its work.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.