强制停止会使应用程序的接收方不被调用吗? [英] Force stop will make app's receiver not being called?

查看:88
本文介绍了强制停止会使应用程序的接收方不被调用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用XML声明的服务,该服务响应 PACKAGE_ADDED 广播意图。
可以正常工作,但是我发现,如果我强制停止应用程序,接收方将不会再收到任何内容。

I have a service declared in XML that responds to PACKAGE_ADDED broadcast intent. It works fine, but I just found out that if I force stop the app, the receiver won't receive anything anymore. It's not being called.

这是正常现象吗?我能做什么?

Is this normal? What can I do?

我需要确保它总是响应。

I need to make sure it always responds.

推荐答案

自Android 3.1版的应用程序无法接收广播意图,直到手动将其注视一次。
首次启动之前,启动器将应用程序视为已停止。 ( http://developer.android.com/about/versions/android-3.1。 html 在已停止的应用程序上启动控件下。)

Since version 3.1 of Android an application cant receive broadcast intents until its stared once manually. Before the first start, the application is considered as "Stopped" by the launcher. (http://developer.android.com/about/versions/android-3.1.html under "Launch controls on stopped applications").

如果您手动强制停止应用程序,则将再次设置此标志,您需要重新启动它手动以使其再次接收事件。

If you manually force stop the application, this flag will be set again and you need to relaunch it manually to allow it to receive the events again.

这篇关于强制停止会使应用程序的接收方不被调用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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