Android Wifi Direct detecta a sus compañeros pero Peer List es emty

Todo funciona bien, pero cuando WifiP2pManager llama onPeersAvailable método onPeersAvailable (lo llama correctamente) la Peers Device List está vacía, lo que no tiene sentido porque si se llama al método, es porque se descubrió un par. S

¿Hay algo mal en mi código? Gracias.

Actividad Principal, Receptor de Difusión y Descubrimiento:

 public class Main extends Activity{ FileManager flManager; Context ctx; LinearLayout lay_found_users; LinearLayout lay_conversations; AddLayoutItem addLayoutItem = new AddLayoutItem(); private final String TAG = "Main"; //Wifi Direct WifiP2pManager mManager; WifiP2pManager.Channel mChannel; BroadcastReceiver mReceiver; IntentFilter mIntentFilter; WifiP2pManager.PeerListListener mPeerListListener; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.act_main); ctx = getApplicationContext(); flManager = new FileManager(ctx); //Wifi Direct mIntentFilter = new IntentFilter(); mIntentFilter.addAction(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION); mIntentFilter.addAction(WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION); mIntentFilter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION); mIntentFilter.addAction(WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION); mManager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE); mChannel = mManager.initialize(this, getMainLooper(), null); mPeerListListener = new WifiP2pManager.PeerListListener(){ @Override public void onPeersAvailable(WifiP2pDeviceList peerList){ Log.i(TAG, "Peers available"); int size = peerList.getDeviceList().size(); Log.i(TAG, String.valueOf(size)); } }; mReceiver = new WDBroadcastReceiver(mManager, mChannel, this, mPeerListListener); WDDiscovery wdDiscovery = new WDDiscovery(mManager, mChannel); wdDiscovery.discover(); } @Override protected void onResume(){ super.onResume(); registerReceiver(mReceiver, mIntentFilter); } @Override protected void onDestroy(){ super.onDestroy(); unregisterReceiver(mReceiver); } public class WDBroadcastReceiver extends BroadcastReceiver { private WifiP2pManager mManager; private WifiP2pManager.Channel mChannel; private Main mActivity; private final String TAG = this.getClass().getSimpleName(); private WifiP2pManager.PeerListListener mPeerListListener; public WDBroadcastReceiver(WifiP2pManager manager, WifiP2pManager.Channel channel, Main activity, WifiP2pManager.PeerListListener peerListListener){ super(); this.mManager = manager; this.mChannel = channel; this.mActivity = activity; this.mPeerListListener = peerListListener; } @Override public void onReceive(Context context, Intent intent){ String action = intent.getAction(); if (WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION.equals(action)){ int state = intent.getIntExtra(WifiP2pManager.EXTRA_WIFI_STATE, -1); if (state == WifiP2pManager.WIFI_P2P_STATE_ENABLED){ Log.i(TAG, "Wifi P2P Enabled"); } else { Log.i(TAG, "Wifi P2P Disabled"); } }else if (WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION.equals(action)){ if (mManager != null){ mManager.requestPeers(mChannel, mPeerListListener); Log.i(TAG, "Peer Discovered"); } }else if (WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION.equals(action)){ // Respond to new connection or disconnections }else if (WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION.equals(action)){ // Respond to this device's wifi state changing } } } 
 public class WDDiscovery { WifiP2pManager mManager; WifiP2pManager.Channel mChannel; private final String TAG = this.getClass().getSimpleName(); public WDDiscovery(WifiP2pManager manager, WifiP2pManager.Channel channel) { mManager = manager; mChannel = channel; } public void discover() { mManager.discoverPeers(mChannel, new WifiP2pManager.ActionListener() { @Override public void onSuccess() { Log.i(TAG, "WiFi P2P Discovery successful"); } @Override public void onFailure(int reasonCode) { Log.i(TAG, "WiFi P2P Discovery error"); } }); } } 

introduzca la descripción de la imagen aquí

FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.