在清单文件中会报出一个Exported receiver dose not required permission的小警告
翻译的意思是不需要权限的接收器,说我们没有给这个接收器权限,这样外部的程序就可以访问到我们的 receiver或者是service了
所以我们要消除这个小警告就要提高receiver或者是service的权限
我们在<manifest>
<!--加入代码-->
<permission
android:protectionLevel="normal"
android:name="com.example.action.RECEIVE_ACTION"/>
</manifest>
"com.example.action.RECEIVE_ACTION"这个是自定义的一个权限,名字可以自己取
然后在receiver标签中加入代码 android:permission="com.example.action.RECEIVE_ACTION"就OK了