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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:04:46+00:00 2026-06-01T17:04:46+00:00

In my code i added all the permissions for Boot Completed on Android manifest

  • 0

In my code i added all the permissions for Boot Completed on Android manifest file..I logged My broadcast receiver,after reboot the control is going in to broadcast receiver But the alarm is not firing up.Actualy i want is a activity is launched after triggering alarm..In normal case(Before Shut down) i am getting the alarm and launched the activity..after reboot it is not happening…

this is my Boadcast receiver

public class AlarmReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
    Log.d("hai", "inside onreceive");
    try {
        if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {


                    Calendar cal = new GregorianCalendar();
                    cal.setTimeInMillis(System.currentTimeMillis());

                    cal.set(Calendar.HOUR_OF_DAY,9);
                    cal.set(Calendar.MINUTE,49);
                    cal.set(Calendar.SECOND, 0);
                    cal.set(Calendar.MILLISECOND, 0);

                    Intent intent1 = new Intent(context,
                            AlarmLauncher.class);
                    intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    intent1.putExtra("alarm_message", "feathersoft Rules!");
                    // In reality, you would want to have a static variable
                    // for the request code instead of 192837
                    PendingIntent sender = PendingIntent.getBroadcast(context, 0, intent1,PendingIntent.FLAG_CANCEL_CURRENT);
                    Log.d("hai",
                            "alarm set");

                    // Get the AlarmManager service
                    AlarmManager am = (AlarmManager) context
                            .getSystemService(context.ALARM_SERVICE);
                    // am.set(AlarmManager.RTC_WAKEUP,
                    // cal.getTimeInMillis(), sender);
                    am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(),
                            sender);
                    Log.d("hai",
                            "Alarm Alert:Inside the boot completed broadcast receiver......");



                Log.d("hai",
                        "Alarm Alert:Inside the boot completed broadcast receiver......");
            }
        } 

    }catch (Exception e) {
            Toast.makeText(
                    context,
                    "There was an error somewhere, but we still received an alarm",
                    Toast.LENGTH_SHORT).show();
            e.printStackTrace();


        }
    try {

    if(intent.getAction().equals(null))
        {

                SharedPreferences sp = context
                        .getSharedPreferences(
                                BigBirdConstants.nameOfPreference,
                                context.MODE_PRIVATE);
                String alrm = sp.getString(
                        BigBirdConstants.pref_myflight_alarm_time, "hello");
                Log.d("hai", alrm);
                Intent newIntent = new Intent(context, AlarmLauncher.class);
                newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                System.out.println("boot completed");
                // newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(newIntent);
            } 
        }catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

}

This is my alarm dumpsys after reboot

$ dumpsys alarm
 dumpsys alarm
  Current Alarm Manager state:

  Realtime wakeup (now=1334031884759):
 RTC_WAKEUP #2: Alarm{460a6c88 type 0 com.android.providers.calendar}
  type=0 when=1334110692157 repeatInterval=0 count=0
  operation=PendingIntent{45dea300: PendingIntentRecord{460a6c10 com.android.p
roviders.calendar broadcastIntent}}
RTC_WAKEUP #1: Alarm{460eb1d0 type 0 com.google.android.gsf}
  type=0 when=1334073656706 repeatInterval=566387000 count=0
operation=PendingIntent{45d0d9c8: PendingIntentRecord{4606f3c0 com.google.an
droid.gsf broadcastIntent}}
  RTC_WAKEUP #0: Alarm{4610cd88 type 0 com.google.android.gsf}
    type=0 when=1334032080140 repeatInterval=1800000 count=0
    operation=PendingIntent{46057dc0: PendingIntentRecord{4610cd10 com.google.an
droid.gsf broadcastIntent}}
  RTC #1: Alarm{45ed7b10 type 1 android}
    type=1 when=1334082600000 repeatInterval=0 count=0
    operation=PendingIntent{45dd2c10: PendingIntentRecord{45e81c08 android broad
castIntent}}
  RTC #0: Alarm{461bf460 type 1 android}
    type=1 when=1334031900000 repeatInterval=0 count=0
    operation=PendingIntent{45cceb98: PendingIntentRecord{45f2b3e0 android broad
castIntent}}

  Elapsed realtime wakeup (now=527752):
  ELAPSED_WAKEUP #2: Alarm{46169c28 type 2 android}
    type=2 when=25881048 repeatInterval=0 count=0
    operation=PendingIntent{45d0c358: PendingIntentRecord{45cc99b0 android broad
castIntent}}
  ELAPSED_WAKEUP #1: Alarm{4610dc40 type 2 com.google.android.gsf}
    type=2 when=995077 repeatInterval=0 count=0
    operation=PendingIntent{460dd5c8: PendingIntentRecord{4610dbc8 com.google.an
droid.gsf broadcastIntent}}
  ELAPSED_WAKEUP #0: Alarm{46011b68 type 2 com.google.android.apps.maps}
    type=2 when=970384 repeatInterval=900000 count=0
    operation=PendingIntent{45f9f478: PendingIntentRecord{45fea1d0 com.google.an
droid.apps.maps startService}}
  ELAPSED #1: Alarm{460da648 type 3 android}
    type=3 when=2557073343 repeatInterval=0 count=0
    operation=PendingIntent{45f84d38: PendingIntentRecord{45e34428 android broad
castIntent}}
  ELAPSED #0: Alarm{4609a418 type 3 android}
    type=3 when=727667 repeatInterval=0 count=0
    operation=PendingIntent{45f7da98: PendingIntentRecord{45e39420 android broad
castIntent}}

  Broadcast ref count: 0

  Alarm Stats:
  com.bigbird.Activity
    20ms running, 1 wakeups
    1 alarms: flg=0x10000004 cmp=com.bigbird.Activity/.AlarmLauncher
  com.google.android.gsf
    47ms running, 1 wakeups
    1 alarms: act=com.google.android.intent.action.GTALK_RECONNECT flg=0x4
  android
    22819ms running, 3 wakeups
    1 alarms: act=com.android.internal.policy.impl.PhoneWindowManager.DELAYED_KE
YGUARD flg=0x4
    8 alarms: act=android.intent.action.TIME_TICK flg=0x40000004
    2 alarms: act=android.content.syncmanager.SYNC_ALARM flg=0x4
$
  • 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-01T17:04:48+00:00Added an answer on June 1, 2026 at 5:04 pm

    I got the problem

    in the pending intent i am used the activity to be launched..thats the fault..in pending intent u should use your Broadcast receiver as intent…

    if (sp.getBoolean(BigBirdConstants.pref_alarm_set, false)) {
                    String alrm = sp.getString(
                            BigBirdConstants.pref_myflight_alarm_time, "hello");
                    String alrmtime[] = new String[2];
    
    
                        alrmtime = alrm.split(":");
    
                        Calendar cal = new GregorianCalendar();
                        cal.setTimeInMillis(System.currentTimeMillis());
                        /*
                         * Integer.parseInt(alrmtime[
                         * 0])
                         */
                        /* Integer.parseInt(alrmtime[1]) */
                        cal.set(Calendar.HOUR_OF_DAY,11);
                        cal.set(Calendar.MINUTE,13);
                        cal.set(Calendar.SECOND, 0);
                        cal.set(Calendar.MILLISECOND, 0);
    
                        Intent intent1 = new Intent(context,
                                AlarmReceiver.class);
                        intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        intent1.putExtra("alarm_message", "feathersoft Rules!");
                        // In reality, you would want to have a static variable
                        // for the request code instead of 192837
                        PendingIntent sender = PendingIntent.getBroadcast(context, 192837, intent1,PendingIntent.FLAG_UPDATE_CURRENT);
                        Log.d("hai",
                                "alarm set");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i've added code config.gem authlogic-oauth, :lib => authlogic_oauth to the environment.rb file in my
I've just installed git on my production server and added all my production code
Edit: Added code (Exception on line 095, 5th time it's hit.) public DataTable ParseBarcodes(String[]
Visual Studio added code analysis ( /analyze ) for C/C++ in order to help
Consider the following situation Code was added to the trunk at revision x A
In my CMS I've added this code <div><?php include(my_contact_form.php) ?></div> which updates to a
On a blank winform code can be added to show lines that intersect (crosshairs)
I have a StackPanel that contains child StackPanels (added in code behind). Parent StackPanel
I added following line of code in .vimrc let g:jslint_status = 'enabled' if exists(jslint_status)
I added functionality to a code base someone else wrote and while the Not

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.