Code example for WifiP2pManager

Methods: stopPeerDiscovery

0
	} 
	 
	private void stopDiscovery() { 
		Log.i(TAG, "stop wifi p2p discovery");
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
			wifiMgr.stopPeerDiscovery(channel, new TaggedActionListener("stopPeerDiscovery"));
		} 
	} 
	 
	public void registerService(String serviceName, String serviceType) {
		if (!isEnabled)
			return; 
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && !isLocalServiceRegistered) {
			Log.d(TAG, "Register service "+ serviceName + " type " + serviceType);
			WifiP2pDnsSdServiceInfo servInfo = WifiP2pDnsSdServiceInfo.newInstance(serviceName, serviceType , null);
			wifiMgr.addLocalService(channel, servInfo, new TaggedActionListener("addLocalService"));
			isLocalServiceRegistered = true;
		} 
	}