title: WiFi Direct on Android not working properly
body: <p>I am trying to develop an app using wifi direct in android Jelly Bean 4.1.1. If p2p is enabled I immedialtely call</p>
  
  <pre><code>mManager.discoverPeers(mChannel, actionListener);
  </code></pre>
  
  <p>After that I am getting a call back to the</p>
  
  <pre><code>onPeersAvailable(WifiP2pDeviceList)
  </code></pre>
  
  <p>I am testing with 2 Samsung(Google) Nexus device and wifi direct is turned on on both. But this call back is returning an empty list of peers. But for instance if I click on the <strong>Search Peers</strong> button on the default wifi direct interface immedialtely the second device fires the</p>
  
  <blockquote>
    <p>WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION</p>
  </blockquote>
  
  <p>and this inturn calls</p>
  
  <pre><code>onPeersAvailable(WifiP2pDeviceList peers)
  </code></pre>
  
  <p>as I am requesting for peers for that event using</p>
  
  <pre><code>mManager.requestPeers(mChannel, WifiDirectService.this);
  </code></pre>
  
  <p>This time I will be able to see the peers. I am seeing this for a number of times.</p>
  
  <p>What could be the possible reason?
  Thanks</p>