Questions tagged [android-alarms]

Android alarms is the facility provided by Android through AlarmManager to start an intent at a given time (by passing a pending intent).

Android alarms is the facility provided by Android through AlarmManager to start an intent at a given time (by passing a PendingIntent) which can be used to start an activity or a service or send a broadcast.

AlarmManager Class Reference

1179 questions
5
votes
1 answer

Overwrite existing alarm

I create an alaram in my app which is calling a BroadcastReceiver to setup notifications ever day with this code: Intent intent = new Intent(Benachrichtigung.CUSTOM_INTENT); PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent,…
Cilenco
  • 6,951
  • 17
  • 72
  • 152
5
votes
1 answer

How to pause and resume an Android Alarm?

I am developping an alarm, which vibrates in time defined intervals. So if I choose 5 seconds, the app will vibrates at each 5 seconds intervals. But I need to stop, pause, and resume the app. This is my class: public class AndroidAlarmService…
androidevil
  • 9,011
  • 14
  • 41
  • 79
5
votes
1 answer

How to run a service from 9 AM to 4 PM daily?

Question :1 => I want to run a service from 9 AM to 4 PM daily. I plans two method.Which one is best? Method 1: Inside Service:(This service initialized at on create of activity when first time application starts) if (9 AM <=current time<=4 PM) { …
Ramprasad
  • 7,981
  • 20
  • 74
  • 135
5
votes
1 answer

Setting a repeating alarm in android

I am trying to set a repeating alarm in android that eventually will go up at a user specified time. However the alarm goes off right away when once it is set, even when I make sure the alarm isn't set to go off until after the alarm has been set.…
johns4ta
  • 886
  • 2
  • 12
  • 38
5
votes
1 answer

calendar.set(Calendar.HOUR_OF_DAY, alarmHour); is not working. What am I doing wrong?

I am setting an alarm for which I take the Hour and Minutes from a TextView and the AM/PM through a Spinner. Here is how I initialize the Calendar object: Calendar calen = Calendar.getInstance(); calen.set(Calendar.HOUR_OF_DAY, alarmHour);…
Shubham
  • 780
  • 3
  • 13
  • 32
5
votes
5 answers

Why is Android ignoring the creation of the Notification?

I have code, and it just does not work, so I ask anyone to help me out. There is very little info on this specific matter. MainActivity public class MainActivity extends Activity { public final int PENDING_INTENT_ID = 8; @Override public void…
Andy
  • 10,553
  • 21
  • 75
  • 125
4
votes
2 answers

Using a broadcast receiver to start AlarmManager in Android?

I am writing a program that fires off an intent to start a service periodically, to do this I have decided to use alarmmanager, I was able to make this do what I wanted in an activity fairly easily but I'm getting an error when attempting to do it…
Edmund Rojas
  • 6,376
  • 16
  • 61
  • 92
4
votes
4 answers

set alarm on selected time and date

I am developing a taskmanager on Android 2.1. I want to set alarm for a task set by date from datepicker and time from time picker Help me with the code.. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
prakash_d22
  • 1,153
  • 5
  • 21
  • 34
4
votes
1 answer

Android 12: Redirect to Alarms & Reminders settings not working

I want to show snackbar to user, if he has Alarms & Reminders turned off in my App (since Android 12 its mandatory to have this settings enabled in order to register Alarms for example to fire Notifications). But on some phones, it is showing…
martin1337
  • 2,384
  • 6
  • 38
  • 85
4
votes
1 answer

Problem with AlarmManager In Android

When I run my application for the first time my alarm is started and it works very well. Intent intent = new Intent(this, Kill_Task.class); PendingIntent pendingIntent = PendingIntent.getBroadcast( this, 0, intent,…
Mehul Akoliya
  • 286
  • 2
  • 9
4
votes
2 answers

Flutter Alarm Manager Missing Plugin Exception

I'm having trouble setting up a daily task to complete certain functions. I've managed to get android_alarm_manager to work, I currently, have it set to print a message in the log every minute for testing purposes but will have it set daily when…
Michael Johnston
  • 718
  • 2
  • 11
  • 25
4
votes
2 answers

Alarm is not working in android when the device is off and on again

I have set the alarm to remind me in android it is working when the device is on. But when i switch off the device and again on that reminder alarm is not working. Can you guys please suggest me how can solve this problem? My code looks like…
4
votes
3 answers

Sending notification via AlarmManager and BroadcastReceiver does not work?

I'm scheduling a notification for 5 days ahead, so I create an alarm using the AlarmManager who fires a PendingIntent which triggers my BroadcastReceiver. If I try the code for 10 seconds, it works. When I try it for 5 days, nothing happens. The…
4
votes
3 answers

alarm not working when app is closed

Alarm is working fine when I am working with the emulator. But not working when i try on actual devices. Output when app is open. RTC #8: Alarm{2c1fc9e type 1 when 1486492260454 user.com.hlthee} tag=*alarm*:user.com.hlthee/.UpdateTables …
Ankur Khandelwal
  • 1,042
  • 3
  • 19
  • 40
4
votes
2 answers

Which context does BroadcastReceivers receive when listening for BOOT_COMPLETED?

AlarmManagers in Android lose all of their registered alarms when phone loses power. I use the following broadcast receiver to trigger at android bootup: public class AlarmBootReceiver extends BroadcastReceiver { @Override public void…