Code example for WifiP2pManager

Methods: initialize

0
				.addAction(WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION);
 
		// Wi-Fi Direct初期化 
		mManager = (WifiP2pManager) activity
				.getSystemService(Context.WIFI_P2P_SERVICE);
		mChannel = mManager.initialize(activity, Looper.getMainLooper(), this);
	} 
 
	@Override 
	public void onChannelDisconnected() { 
		// 再チャレンジ 
		mChannel = mManager.initialize(getActivity(), Looper.getMainLooper(),
				this);
	} 
 
	@Override 
	public void onResume() { 
		super.onResume(); 
		mReceiver = new WiFiDirectBroadcastReceiver(this);
		getActivity().registerReceiver(mReceiver, mIntentFilter);
	}