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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:57:43+00:00 2026-05-25T23:57:43+00:00

I have the following problem. I have 2 classes. 1 is called AlarmService and

  • 0

I have the following problem. I have 2 classes. 1 is called AlarmService and the other is called TimeAlarm which extends BroadcastReceiver.
The App should do the following thing: It should generate a new Alarm to a time specified in the preferences (Which it already does…) also in Logcat i can see how the Alarm gets triggered. But the problem is, that the Notification which should be shown does not show up in the StatusBar.

Here is all the code i have for this:

AndroidManifest.xml:

<receiver android:name="com.ikalma.alarmmanager.TimeAlarm">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </receiver>

AlarmService.java:

private Context context;
private PendingIntent mAlarmSender;

public AlarmService(Context context) {
    this.context = context;
    Intent notifyIntent = new Intent(Intent.ACTION_MAIN);
    notifyIntent.setClass(context, myActivity.class);
    mAlarmSender = PendingIntent.getBroadcast(context, 0, notifyIntent, 0);
}

public void startAlarm(int stunde, int minute) {
    Calendar updateTime = Calendar.getInstance();

    updateTime.set(Calendar.HOUR_OF_DAY, stunde);
    updateTime.set(Calendar.MINUTE, minute);
    updateTime.set(Calendar.SECOND, 00);

    AlarmManager am = (AlarmManager) context
            .getSystemService(Context.ALARM_SERVICE);
    am.setRepeating(AlarmManager.RTC_WAKEUP, updateTime.getTimeInMillis(),
            AlarmManager.INTERVAL_DAY, mAlarmSender);
}

TimeAlarm.java:

@Override
public void onReceive(Context context, Intent intent) {
    Log.e("TEST", "onReceive() called...");
}

The Receiver in the Manifest is inside of the Tag so that should not be a problem.
The problem is, that if i restart my device, it gets called. But not if an Alarm gets triggered.
But the onReceive() method should also be called if an alarm gets triggered, shouldn’t it?

Thanks for your help!

  • 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-25T23:57:44+00:00Added an answer on May 25, 2026 at 11:57 pm

    your intent filter is only listening to boot complete intents and not your own alarm broadcast intent action. update your intent filter so that your broadcast intent is also received (that means for your special case add the action of Intent.ACTION_MAIN to your intent filter)

    <receiver android:name="com.ikalma.alarmmanager.TimeAlarm">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <action android:name="android.intent.action.MAIN" />
        </intent-filter>
    </receiver>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem. I have three classes, A, B and C. A
I'm learning C# and I encountered the following problem. I have two classes: base
I have the following problem. I have two classes, in this case A and
In my current project, I have classes which are modeled like the following. At
I have the following problem. I got a class PluginLoader which oversees loading of
I have encountered the following problem which proved to me that I know far
I have following problem: when my session expires and user clicks on Ajax.Actionlink, Logon
I have following problem: I have built a tabbar application with 4 tabs. I
I have following problem, Code: String a=Yeahh, I have no a idea what's happening
I have the following problem: I have 2 Strings of DNA Sequences (consisting of

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.