Code example for WifiManager

Methods: createMulticastLock

0
 
	public void initialize() { 
		_wifi_manager = (WifiManager)_context.getSystemService(Context.WIFI_SERVICE);
		 
		// listen to multicast packets 
		_mcast_lock = _wifi_manager.createMulticastLock(TAG);
		_mcast_lock.acquire();
		 
//		_wifi_p2p_manager = (WifiP2pManager)_context.getSystemService(Context.WIFI_P2P_SERVICE); 
//		_wifi_p2p_manager.initialize(this,  null, _action_listener); 
		 
	} 
	 
	public void destroy() { 
//		_wifi_p2p_manager = null; 
		if (_mcast_lock != null) {
			_mcast_lock.release();
		} 
		_wifi_manager = null;
	}