Android : How can I unregister a service registered with NsdManager?

on Sunday, August 3, 2014


I am trying to clean up properly a service registered with



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


I do call



myNsdManager.unregisterService(myRegistrationListener);


in onDestroy(), but the problem is that when I recompile my app in Eclipse, it reinstalls the app by closing the previously running instance without calling the onDestroy(), leaving my previous registered service still registered and getting discovered by myNsdManager.discoverServices(). How can I properly unregister my previous service? I did search google but no answer yet.


Thank you


0 comments:

Post a Comment