Code example for WifiP2pManager

Methods: connect

0
	public void unRegisterObserver(ManagerP2pDeivce notify) {
		observerList.remove(notify);
	} 
 
	public void connect(WifiP2pConfig config) {
		mWifiP2pManager.connect(channel, config, null);
	} 
 
	@Override 
	public void wifiP2pConnected() { 
		notifyConnect(); 
	} 
 
	private void getPeerDevice(final boolean flag) {
		final ArrayList<WifiP2pDevice> serverList = new ArrayList<WifiP2pDevice>();
		mWifiP2pManager.requestPeers(channel, new PeerListListener() {
			@SuppressLint({ "NewApi", "NewApi", "NewApi", "NewApi", "NewApi", 
					"NewApi", "NewApi", "NewApi", "NewApi", "NewApi", "NewApi", 
					"NewApi", "NewApi", "NewApi" }) 
			public void onPeersAvailable(WifiP2pDeviceList peers) {
				if (!flag) {