Code example for NsdManager

Methods: unregisterService

0
	} 
	 
	private void unregisterService() { 
		if (isRegistered) {
			Log.i(TAG, "unregister ShareService");
			nsdMgr.unregisterService(registrationListener);
		} 
	} 
 
	void updateExternalStorageState() { 
		String state = Environment.getExternalStorageState();
		if (Environment.MEDIA_MOUNTED.equals(state)) {
			externalStorageAvailable = true;
		} else { 
			externalStorageAvailable = false;
		} 
		if (shareStarted && !externalStorageAvailable) {
			stopSelf();
		} else if (shareStarted) {
			// start server 
			startSharingServer();