Code example for WifiManager

Methods: disableNetworkdisconnect

0
	/** 
	 * 断开当前连接的网络 
	 */ 
	public void disconnectWifi() { 
		int netId = getNetworkId();
		mWifiManager.disableNetwork(netId);
		mWifiManager.disconnect();
		mWifiInfo = null;
	} 
 
	/** 
	 * 检查当前网络状态 
	 *  
	 * @return String 
	 */ 
	public void checkNetWorkState() { 
		if (mWifiInfo != null) {
			Log.i(TAG, "网络正常工作");
		} else { 
			Log.i(TAG, "网络已断开");
		}