Code example for WifiP2pManager

Methods: discoverPeers

0
	/** 
	 * Initiate peer discovery to start the discovery process. Discovery will 
	 * remain active until a connection is initiated or a P2P group is formed. 
	 */ 
	public void startOneDiscovery() { 
		mManager.discoverPeers(mChannel, new WifiP2pManager.ActionListener() {
			@Override 
			public void onSuccess() { 
				// Initiation successful. Do nothing. 
			} 
			 
			@Override 
			public void onFailure(int reason) {
				// TODO: notify the user. 
			} 
		}); 
	} 
	 
	/** 
	 * Remove all peers and clear all fields. This is called when WifiBroadcastReceiver 
	 * receives a state change event.