androidapplicationcontextnetwork-service

Android `getSystemService(Context.NSD_SERVICE)` takes a very long time


Android call to applicationContext.getSystemService(Context.NSD_SERVICE) takes a very long time. Sometimes it returned after about 1 minute and other times a lot more.

Any idea what's the issue here?


Solution

  • Restarting the phone did the trick.

    It's still an issue, because requesting users to restart their phone is bad experience.