title: NsdManager can't be found using context.getSystemService
body: <p>I'm having an issue with using context.getSystemService(Context.NSD_SERVICE). It just crashes. The code is below:</p>
  
  <p>My network service discovery helper:</p>
  
  <pre><code>public NetworkServiceDiscoveryHelper(Context context)
  {
      mContext = context;
      mNetworkDiscoveryManager = (NsdManager) context.getSystemService(Context.NSD_SERVICE);
  }
  </code></pre>
  
  <p>My Activity Class:</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
      mNsdHelper = new NetworkServiceDiscoveryHelper(this);
      mNsdHelper.initializeNsd();
  
  
  }
  </code></pre>
  
  <p>I've been following sample code from <a href="http://developer.android.com/training/connect-devices-wirelessly/nsd.html" rel="nofollow">http://developer.android.com/training/connect-devices-wirelessly/nsd.html</a>, their activity constructor is slightly different:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      mStatusView = (TextView) findViewById(R.id.status);
  
      mUpdateHandler = new Handler() {
              @Override
          public void handleMessage(Message msg) {
              String chatLine = msg.getData().getString("msg");
              addChatLine(chatLine);
          }
      };
  
      mConnection = new ChatConnection(mUpdateHandler);
  
      mNsdHelper = new NsdHelper(this);
      mNsdHelper.initializeNsd();
  
  }
  </code></pre>
  
  <p>Can somebody explain to me, why my implementation is not working, do I need extra functionality? I'm basically was just trying to set test this functionality by creating a service and then using the same phone to find that service again. I've only implemented a network service helper and the activity so far. Do I need to set up any additional functionality.</p>