Code example for WifiP2pManager

Methods: cancelConnect

1
 
    /** 
     * Disconnects this device from any connections 
     */ 
	public void disconnect() { 
		manager.cancelConnect(channel, new ActionListener() {
			 
			@Override 
			public void onSuccess() { 
				Log.d(TAG, "Disconnected from device");
			} 
			 
			@Override 
			public void onFailure(int reason) {
				Log.d(TAG, "Couldn't disconnect from device");
			} 
		}); 
	} 
 
    private String TAG = "TUNETETHER";