Code example for WifiManager.WifiLock

Methods: acquire, setReferenceCounted

0
		if (wifi.isConnected()) {
			if (wifiLock == null)
			{ 
		        WifiManager wm = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
		        wifiLock = wm.createWifiLock(WifiManager.WIFI_MODE_FULL , "com.zns.comicdroid.wifilock");
		        wifiLock.setReferenceCounted(true);
		        wifiLock.acquire();
			} 
			else { 
				wifiLock.acquire();
			} 
	        return true; 
		} 
		return false; 
	} 
	 
	public static int BackupDataToFile(DBHelper db, File fileSql, String imagePath)
	throws IOException { 
		DataOutputStream writer = null;
		int byteCount = 0;