public void stopSearch() { Log.d(TAG, "Stop search"); mStarted = false; mStopped = true; leaveGroup(mMulticastAddress); NetWorkUtil.releaseWifiMultiCastLock(); closeSocket(); mInstance = null; }
public void startSearch() { Log.d(TAG, "Start search."); if (mStarted) { Log.d(TAG, "startSearch() ignore, search is already started."); return; } mStarted = true; NetWorkUtil.acquireWifiMultiCastLock(mContext); Thread searchThread = new Thread(this); searchThread.start(); }