How can I unregister a service registered with NsdManager?

I am trying to properly clean up a service registered with

myNsdManager.registerService(serviceInfo, NsdManager.PROTOCOL_DNS_SD, myRegistrationListener)

      

I'm calling

myNsdManager.unregisterService(myRegistrationListener);

      

in onDestroy (), but the problem is that when I recompile my application in Eclipse, it reinstalls the application, closing the previously started instance, without calling onDestroy (), leaving my previous registered service still registered and detecting myNsdManager.discoverServices (). How can I properly deregister my previous service? I have searched google but there is no answer yet.

thank

+3


source to share





All Articles