首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用android创建来自arrayList的提醒

用android创建来自arrayList的提醒
EN

Stack Overflow用户
提问于 2015-01-15 02:38:09
回答 1查看 57关注 0票数 0

我已经创建了一个有特定时间段的饮食图arrayList,现在我想创建一个提醒,它将通知什么时候是特定的饮食与声音。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-02-13 11:04:07

虽然这个问题有点老,但它仍然可以帮助其他用户。您必须使用警报管理器在特定的时间触发。

代码语言:javascript
复制
Intent intent = new Intent(this, MyService.class);
PendingIntent pintent = PendingIntent.getService(this, 0, intent, 0);
AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarm.setRepeating(AlarmManager.RTC_WAKEUP,<here set time when you want to trigger>,<here you can set time to repeat after trigering continusosly>,pintent); 
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27955955

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档