The method getContentResolver() is undefined for the type Discoverer
<p>I am getting the error     <code>getContentResolver() is undefined for the type Discoverer</code></p>

<p>Below is my code. Please help me out</p>

<p>i start by using</p>

<pre><code>    new Discoverer((WifiManager) getSystemService(Context.WIFI_SERVICE))
            .start();
</code></pre>

<p>and this follows in the class file</p>

<pre><code>  public void run() {
    try {
      DatagramSocket socket = new DatagramSocket(DISCOVERY_PORT);
      socket.setBroadcast(true);
      socket.setSoTimeout(TIMEOUT_MS);

        android_id = Secure.getString(getContentResolver(), Secure.ANDROID_ID);

      sendDiscoveryRequest(socket);
      listenForResponses(socket);
    } catch (IOException e) {
      Log.e(TAG, "Could not send discovery request", e);
    }
  }
</code></pre>

<p>and the mainactivity part</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);


    android_id = Secure.getString(getContentResolver(), Secure.ANDROID_ID);


    new Discoverer((WifiManager) getSystemService(Context.WIFI_SERVICE))
            .start();
    setContentView(R.layout.startscreen);
</code></pre>
