Code example for WifiManager

Methods: createMulticastLock

0
 
    	servers = new ArrayList<Map<String,String>>();
    	 
    	//By default, the android wifi stack will ignore broadcasts, fix that 
    	WifiManager wm = (WifiManager)getSystemService(Context.WIFI_SERVICE);
    	multicastLock = wm.createMulticastLock("mpdroid_bonjour");
    	 
    	try { 
			jmdns = JmDNS.create();
			jmdns.addServiceListener("_mpd._tcp.local.", this);
		} catch (IOException e) {
			//Do nothing, stuff will just not work 
		} 
			 
		listAdapter = new SimpleAdapter(this, servers, android.R.layout.simple_list_item_1, new String[]{SERVER_NAME}, new int[]{android.R.id.text1});
		getListView().setAdapter(listAdapter);
    } 
     
    @Override 
    protected void onPause() { 
    	if(multicastLock == null || jmdns == null) {