測試廣播功能,接收開機廣播練習:
創建receiver,Android Manifest.xml文件注冊兩個地方
1.權限
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED">
2.接收器意圖過濾器
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
3.模擬器重啟方法