在AlarmManager报警时得到进程被终止擦除

编程入门 行业动态 更新时间:2024-10-16 20:30:46
本文介绍了在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 ?

下面是我的需要:

  • 这则警报十分可靠,即使应用程序被杀害或者即使手机重启。
  • 同去给广播接收机。
  • 感谢你在前进,

    推荐答案

    如果用户任务,杀死或强制停止您的应用程序,你的报警注册。而且,在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报警时得到进程被终止擦除

    本文发布于:2023-11-27 07:46:36,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1637166.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:进程   擦除   AlarmManager

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!