在AlarmManager报警时得到进程被终止擦除 [英] Alarm in the AlarmManager get erased when process is killed

查看:159
本文介绍了在AlarmManager报警时得到进程被终止擦除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个新手在android系统,所以请多多包涵。
我的主要活动将创建并在其中应该在特定的时间来触发报警器报警的经理,我的主要活动也创造了广播接收机,它假设接收意图报警解雇,一切工作良好,直到任务管理器杀我的应用程序。
我已经检查了AlarmManager中的PendingIntent列表,并验证我的闹钟正从报警管理抹去,我尝试添加服务,从服务注册的报警,我有红,也许是因为我的广播接收机的IntentFilter的定义在code,而不是在明显的应用过程中被杀害后被杀,而我被困在这个问题上两周:-(,大搞不清,我的设计是错误的?

I'm a newbie in android so please bear with me. My Main activity creates and alarm in the alarm manager which supposed to fire in specific time, my main Activity also create Broadcast receiver which suppose to receive the Intent that the alarm fired, everything is working good until Task manager killing my App. I've check the PendingIntent list in the AlarmManager and verify that my alarm is getting erased from the Alarm Manager, I try to add service and register alarm from the service, I've red that maybe because my IntentFilter of the Broadcast receiver is defined in code and not in manifest it get killed after app process is killed, and I'm stuck on this issue for two weeks :-(, with big confuse, my design is wrong ?

下面是我的需要:


  1. 这则警报十分可靠,即使应用程序被杀害或者即使手机重启。

  2. 同去给广播接收机。

感谢你在前进,

推荐答案

如果用户任务,杀死或强制停止您的应用程序,你的报警注册。而且,在Android 3.1以上版本,没有您的应用程序将再次直到用户手动启动你的活动之一运行。

If the user task-kills or force-stops your application, your alarms are unregistered. And, on Android 3.1+, nothing of your app will run again until the user manually launches one of your activities.

有什么是你可以做这个,除了做你最好写一个高品质的应用程序,用户不会有任何需要或希望强制停机。

There is nothing that you can do about this, other than to do your best to write a high-quality application that the user will have no need or wish to force-stop.

这篇关于在AlarmManager报警时得到进程被终止擦除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆