1.由一个问题引发的思考:
对于启动一个广播,静态注册一个广播,intent-filter中什么也不设置,在发送广播中对intent也不设置,是否可以匹配到?
写代码验证,直接编译不通过:
Missing one of the key attributes 'action#name,category#name' on element intent-filter at AndroidManifest.xml:20:13-25:29
2.IntentFilter过滤规则的全面学习
(1)IntentFilter的解释:
/** * Structured description of Intent values to be matched. An IntentFilter can * match against actions, categories, and data (either via its type, scheme, * and/or path) in an Intent. It also includes a "priority" value which is * used to order multiple matching filters. * * <p>IntentFilter objects are often created in XML as part of a package's * { @link android.R.styleable#AndroidManifest AndroidManifest.xml} file, * using { @link android.R.styleable#AndroidManifestIntentFilt