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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:35:12+00:00 2026-05-31T18:35:12+00:00

I tried to get my application run at a specified time but I can’t

  • 0

I tried to get my application run at a specified time but I can’t get it working. I can see my pending alarms while running adb shell dumpsys alarm and the alarm stat that increasing every time I run the AlarmActivity.

I added adb shell dumpsys alarm output where we can see the alarm. I can’t see what is wrong
Thanks for help

Here there is my AlarmActivity code:

package net.dradge.alarm;

import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

public class AlarmActivity extends Activity{
    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.main);
    }

    protected void onResume(){
        super.onResume();
        this.setAlarm();
    }

    public class AlarmReceiver extends BroadcastReceiver{
        public void onReceive(Context context, Intent intent){
            Log.w("net.dradge.alarm", "Alarm received");
            AlarmActivity.this.setAlarm();
        }
    }

    private synchronized void setAlarm(){
        Calendar date = Calendar.getInstance();

        AlarmManager manager = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
        Intent alarmIntent = new Intent(this, AlarmReceiver.class);
        PendingIntent operation = PendingIntent.getBroadcast(AlarmActivity.this, 0, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
        manager.set(AlarmManager.RTC_WAKEUP, date.getTimeInMillis() + 30 * 1000, operation);

        DateFormat df = DateFormat.getDateTimeInstance();
        Log.w("net.dradge.alarm", "Alarm set to " + df.format(new Date(date.getTimeInMillis() + 30 * 1000)));
    }
}

Here there is the Manifest code:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="net.dradge.alarm"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".AlarmActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <receiver android:name=".AlarmActivity.AlarmReceiver"></receiver>
    </application>

</manifest>

adb shell dumpsys alarm
Current Alarm Manager state:

  Realtime wakeup (now=1332181365617):
  RTC_WAKEUP #2: Alarm{45260f00 type 0 com.android.providers.calendar}
    type=0 when=1332231022777 repeatInterval=0 count=0
    operation=PendingIntent{4521fdf8: PendingIntentRecord{45260e88 com.android.providers.calendar broadcastIntent}}
  RTC_WAKEUP #1: Alarm{451d51b8 type 0 android}
    type=0 when=1332201600000 repeatInterval=0 count=0
    operation=PendingIntent{44f98c98: PendingIntentRecord{45084d80 android broadcastIntent}}
  RTC_WAKEUP #0: Alarm{45222b40 type 0 com.google.android.gsf}
    type=0 when=1332182126363 repeatInterval=1800000 count=0
    operation=PendingIntent{45285370: PendingIntentRecord{44f58970 com.google.android.gsf broadcastIntent}}
  RTC #1: Alarm{45142d08 type 1 android}
    type=1 when=1332241200000 repeatInterval=0 count=0
    operation=PendingIntent{4504aba8: PendingIntentRecord{4504ab70 android broadcastIntent}}
  RTC #0: Alarm{451c1b90 type 1 android}
    type=1 when=1332181380000 repeatInterval=0 count=0
    operation=PendingIntent{450363c0: PendingIntentRecord{450548d8 android broadcastIntent}}

  Elapsed realtime wakeup (now=505486995):
  ELAPSED #0: Alarm{45201280 type 3 android}
    type=3 when=505988995 repeatInterval=0 count=0
    operation=PendingIntent{44ff4190: PendingIntentRecord{44f6b9a0 android broadcastIntent}}

  Broadcast ref count: 0

  Alarm Stats:
  net.dradge.alarm
    23ms running, 4 wakeups
    4 alarms: flg=0x4 cmp=net.dradge.alarm/.AlarmActivity$AlarmReceiver
  com.google.android.gsf
    13965ms running, 280 wakeups
    280 alarms: flg=0x4
  com.android.providers.calendar
    195ms running, 6 wakeups
    6 alarms: act=com.android.providers.calendar.SCHEDULE_ALARM flg=0x4
  android
    105577ms running, 7 wakeups
    6 alarms: act=android.intent.action.DATE_CHANGED flg=0x20000004
    2 alarms: act=com.android.internal.policy.impl.PhoneWindowManager.DELAYED_KEYGUARD flg=0x4
    561 alarms: act=android.intent.action.TIME_TICK flg=0x40000004
    305 alarms: act=com.android.server.ThrottleManager.action.POLL flg=0x4
    5 alarms: act=com.android.service.Watchdog.CHECKUP 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-05-31T18:35:13+00:00Added an answer on May 31, 2026 at 6:35 pm

    I think your receiver should be declared as

    <receiver android:name=".AlarmActivity$AlarmReceiver"></receiver>
    

    as it is an inner class.

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

Sidebar

Related Questions

I tried to run VBA application on someone else's computer, but I get an
UPDATE As I've tried to get MEF working throughout my application, I'm coming across
Firstly I tried to get fabric working, but it kept asking me for a
i have tried to get the sine wave example running on an AsioOut, but
Today I tried including the apache.commons.codec package in my Android application and couldn't get
I get a communication link failure while application tries to establish a connection with
I wrote an application that tried to create a default HBaseConfiguration, but when I
I've run into a problem with an iPhone core data application that I'm working
I tried to get avatar at single (post) page by these codes <?php echo
When i tried to get the current location of a user via FQL, Graph

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.