问题标签 [repeatingalarm]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - 带有 ELAPSED_REALTIME_WAKEUP 的 AlarmManager 未更新 PendingIntent
这没有任何问题:
该代码有效。每次我们运行此代码时,它都会使用 ID (mAlarmID) 更新待处理的意图。
但是,如果手机处于深度睡眠状态,上述代码不会触发。所以我们必须使用 ELAPSED_REALTIME_WAKEUP。
检查后adb shell dumpsys alarm
,RTC_WAKEUP 总是找到并更新正确的待处理意图。然而,使用带有 ELAPSED_REALTIME_WAKEUP 的警报管理器,总是会创建新的待处理意图,无论 id 是什么。这意味着什么?
- 在 #1 中,每次代码运行时,您总是会在 dumpsys 警报中找到一个警报。
- 在 #2 中,每次代码运行时,您都会在 dumpsys 警报中找到 ONE MORE 警报。
这是错误吗?那么如何使用此代码,以便您始终拥有最多 1 个警报?
android - 当用户从最近的应用程序列表中删除应用程序时如何取消警报管理器警报?
根据此问题的评论:“标准 Android 仅允许您从 Android 3.0+ 上的该列表中删除内容,这样做不会影响您的 AlarmManager 事件”。
如果用户从最近的应用程序列表中滑动应用程序,我想取消警报,但我们似乎无法处理从可以取消警报的最近应用程序列表中滑动应用程序。我在应用程序中有选项供用户取消执行此代码的警报:
但是当app被强行移除时,如何取消闹钟呢?我不想在应用程序关闭时取消警报(按返回或主页按钮)。
android - Alarm Repeats in Wrong Intervals Android
I am making an alarm application in android,which will trigger alarm daily at 8:00 pm.I am using this code to trigger the alarm
and the service class is
Now the problem is that I am getting same notifications two times a day.I want to fire the notification once in a day but it is not doing like this.The alarm is repeating in wrong interval of time.Can anyone please help me.
android - android repeating alarm, should repeat on monthly basis and on same day for each month so on after its set
alarm should repeat on monthly basis, once a month on same date for each month so on after its set like if i place alarm on october 31, then it should repeat on 31 of months having 31 days, as we don't have same number of days for each month I'am having trouble with figuring out the interval of this alarm, please help me how to figure out what this INTERVAL_Value has to be or how to handle it in another way
android - 在android中的特定日期的两个特定日期之间设置警报通知
你好朋友我想设置两个特定日期的通知,例如
日期 1= 2014/10/30
日期2=2015/10/30
并且警报应该在每个月的第 5 天(意味着 date=5)通知一次,直到date2。
我怎样才能实现这个任何想法谢谢提前?
alarmmanager - Android:警报和 IntentServices
在对一起实现 IntentServices 和 Alarms 进行了大量研究之后,我想出了这个。我不确切知道这段代码会发生什么,所以我需要帮助才能确切知道发生了什么。
我的目标是每分钟调用一次 refreshKeywords() 方法。另外,如果多次调用 onNewItemAdded() 方法会发生什么?
对不起,如果这个问题很愚蠢,我是初学者。
android - 向重复广播接收器发送更新
我有类似以下内容的内容,用于IntentService
通过重复调用 aBroadcastReceiver
来轮询服务器更新:
在轮询服务器和使用 aResultReceiver
获取服务器更新方面,上述方法效果很好。但是,我需要向轮询服务提供一些反馈,以便更改我的更新查询。
我应该如何向投票服务提供反馈?如果需要更新查询,我是否只需要取消当前警报并再次设置意图?有没有比取消更好的方法?
android - 多次报警崩溃
我目前正在开发一个提醒应用程序,到目前为止我已经设置了 2 个闹钟:一个每天都会响起(AlarmX),如果它是正确的日期,则设置另一个闹钟(Alarm)来唤醒屏幕。
这段代码在我的脑海中是有道理的,但它没有执行我想要的,并且 logcat 显示错误,我不明白他是如何捕获的。
这是代码,也许你看到了我没有看到的东西。
AlarmX - 扩展类BroadcastReceiver
此方法使应用程序崩溃,并且永远不会调用此类的 onReceive() 方法。我是这样称呼它的Fragment
:
AlarmX alarm = new AlarmX();
alarm.SetAlarm(getActivity().getApplicationContext());
还有一个 Alarm 类 - 与 AlarmX 相同,但根据日志 cat 得到错误,即使它没有被调用。
现在据我所知,即使我没有调用警报,并且由于我没有将包传递给它而创建了一个空指针异常,但AlarmX
在am.setRepeating()
命令中触发警报方法时也是如此。这是输出...onReceive()
onReceive()
logcat
谢谢!
编辑 - Manifest.xml 这是我在 Manifest 文件中声明接收器的方式:
android - android警报:警报接收器可以在X重复后取消警报/
我的 android 应用程序允许用户选择一个项目并在其上设置警报。我正在尝试通过重复警报来实现这一点,但我不希望警报永远重复。我希望它在 2 次重复后自动取消。例如,用户选择一个项目并将闹钟设置为 30 分钟。三十分钟后,警报响起(通知已发送),但用户除了使警报静音之外没有采取任何行动。五分钟后,如果用户未对所选项目采取任何操作,则会重复警报。再过五分钟,如果用户仍未采取任何行动,则会重复警报。
如果到达第二次提醒,无论用户是否采取行动,我都想取消警报。
我很确定我可以在警报接收器类之外进行管理,但是在类中是否有办法确定特定项目的警报被调用了多少次?我的警报接收器类扩展了服务。
谢谢,-马尔
android - Android 警报管理器不重复
我的代码:(报警间隔24小时)
假设我在 1 月 3 日 11:00 调用此函数据我了解,警报管理器必须执行两次
1 月 2 日 10:20(因为我添加了calSet.add(Calendar.DATE,-1))
1 月 3 日 10:20(因为现在已经是 11:00)
但是,警报管理器只触发一次。有人可以帮我解决这个问题吗?
我什至试过
我怎样才能让它在 1 月 3 日 11:00 触发两次(在这种情况下)