高版本Android直接發送廣播是無法接收的
e.g.
1 sendBraodcast(intent);
需要在前面加上(前一個String為接收廣播應用的項目地址,后一個為該廣播類的地址)
1 intent.setComponent(new ComponentName("com.example.broadcasttest","com.example.broadcasttest.MyBroadcastReceiver"));
高版本Android直接發送廣播是無法接收的
e.g.
1 sendBraodcast(intent);
需要在前面加上(前一個String為接收廣播應用的項目地址,后一個為該廣播類的地址)
1 intent.setComponent(new ComponentName("com.example.broadcasttest","com.example.broadcasttest.MyBroadcastReceiver"));
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。