2018-12-20 17:34:55.588 749-767/system_process W/BroadcastQueue: Background execution not allowed: receiving Intent { act=com.corn.ui.setting.Action.TEST_BROADCAST flg=0x10 } to com.corn/.biz.setting.CornTestBroadcastReceiver
上图else if中条件,与官方文档阐述一致,想要广播发送继续生效,可使此条件不知足便可。
对应的,通常能够指定对应的广播接收器Component,或对应的广播接收器包名。
对应intent,经常使用的具体方法能够是:intent.setClass()或intent.setComponent()或intent.setPackage()等写法。
进一步,官方文档中指出了ACTION_PACKAGE_REPLACED 就是一种隐式广播,而ACTION_MY_PACKAGE_REPLACED 则为显式广播,能够经过搜索代码进一步核实下,看看基本写法是否与上述逻辑一致。