Code example for WifiP2pManager

Methods: discoverPeers

0
    } 
     
    //called when send button is clicked 
	public void onClick(View v) {
		if(isWifiP2pEnabled) {
			manager.discoverPeers(channel, new WifiP2pManager.ActionListener() {
		 
				public void onFailure(int reason) {
					Log.d(ECnETActivity.TAG, "Peers discover failed: " + reason);
					Toast.makeText(ECnETActivity.this, "Discovery Failed : " + reason, Toast.LENGTH_SHORT).show();
					 
				} 
		 
				public void onSuccess() { 
					Log.d(ECnETActivity.TAG, "Disovering peers initiated...");
					 
				} 
				 
			});