用于测试手机是否可接受组播 打开组播锁的关键代码 WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); mMulticastLock = wifiManager.createMulticastLock("multicast.test"); if (mMulticastLock != null){ mMulticastLock.acquire(); }