-
0 votesanswersviews
使用报警管理器重复报警
我正在尝试制作一个警报应用程序,从用户那里获取多个“n”时间输入并在这些特定时间响铃 . 为此,我为小时和分钟条目创建了一个EditTexts数组 . 在启动按钮的onclick监听器中,我希望为所有输入的时间输入初始化报警管理器 . 创建一个日历数组后,我是否应该创建一个意图数组和待定意图以及警报管理器对象 - 每个日历对象各一个? 这是我的开始按钮的代码: public void setAle... -
0 votesanswersviews
如何停止即将发生的警报触发器
public class MyAlarm implements IAlarm { AlarmManager manager; private Context context; public MyAlarm(Context context) { this.context = context; manager = (AlarmManager) ... -
1 votesanswersviews
AlarmManager安排的IntentService有时会死掉
我有一个应用程序,每分钟都会启动一个IntentService,在此期间获取UsageStats和UsageEvents . 我使用AlarmManager的setExact()方法来设置执行IntentService的时刻,并在IntentService的onCreate方法上再次调用setExact()来安排下一分钟执行IntentService . 我这样做是因为AlarmManager的方... -
15 votesanswersviews
AlarmManager在错误的时间触发警报
我管理一切都可以创建一个通知服务,用于通过警报触发通知 . 不幸的是,使用AlarmManager设置警报不能正常工作 . 它会在几分钟后发射(不完全是几小时,这表明存在时区问题) . 循环周期为1周,因此我使用常数INTERVAL_DAY并将其乘以7.为了确保一个PendingIntent不替换另一个,我将dayOfWeek作为第二个参数传递给PendingIntent.getService()... -
1 votesanswersviews
无法取消重复警报Android
我已经阅读了有关Android,AlarmManager和取消的所有问题 . 我目前使用 Activity 启动接收器: long msInterval = 1; Intent intent = new Intent(this, Updater.class); intent.setAction("theAction"); PendingIntent pendingIntent...