Code example for WifiManager.WifiLock

Methods: setReferenceCounted

0
				.getSystemService(Context.WIFI_SERVICE);
		wifiManager.setWifiEnabled(true);
		this.wifiLock = wifiManager.createWifiLock(WIFI_MODE_WAKEUP, TAG
				+ ".wifilock"); 
		if (wifiLock != null)
			wifiLock.setReferenceCounted(false);
		this.wifiMeasurer = new WifiMeasurer();
		this.executor = new PeriodicExecutor(context, TAG + ".wifiscan",
				wifiMeasurer);
		this.isStarted = false;
		this.isRegistered = false;
	} 
 
	@Override 
	synchronized public boolean startPeriodicMeasures(long period) {
		if (isStarted)
			return false; 
		executor.start(period, true);
		isStarted = true;
		return true;