很多人遇到过广播收不到的问题,比如Google Play推广安装广播没有收到等,诸如这些问题,又都是什么原因呢,这篇文章将进行回答.
从Android 3.1(HoneyComb) 也就是API 12开始,Android引入了一套新的启动控制,这就是程序的停止状态.那让我们看一下Google对于程序的停止状态的描述.
什么是程序的停止状态
从Android 3.1开始,系统的包管理器开始跟踪处理停止状态的程序.并且提供了方法来控制从后台进程或者其他程序对它们的启动.
Note that an application\'s stopped state is not the same as an Activity\'s stopped state. The system manages those two stopped states separately.
注意 程序的停止状态和Activity的停止状态不同,系统会单独处理这两种状态.
The platform defines two new intent flags that let a sender specify whether the Intent should be allowed to activate components in stopped application. Android平台提供了两个intent flags,用来让发送广播的一方决定广播是否需要同时发送给已经停止的程序.
FLAG_INCLUDE_STOPPED_PACKAGES — Include intent filters of stopped applications in the list of potential targets to resolve against. 将已经支持的程序加入到能处理intent的目标处理者.
FLAG_EXCLUDE_STOPPED_PACKAGES — Exclude intent filters of stopped applications from the list of potential targets. 在能处理intent的目标处理者中不包含已经停止的程序.
本文地址:https://www.stayed.cn/item/9060
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我