Code example for NsdManager

Methods: unregisterService

0
    /** 
     * Unregister service from mDNS/DNS-SD. 
     */ 
    void unregisterService() { 
        if (regstrationListenerRegistered)
            nsdManager.unregisterService(registrationListener);
    } 
 
    // Activity's lifecycle methods. 
 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
 
        ensureSystemServices(); 
    } 
 
    @Override 
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);