I want to get the wi-fi direct name when I execute request peers, here is my code:
if (WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION.equals(action)) {
Log.d(tag, "success discover the peers ");
if (mManager != null) {
mManager.requestPeers(mChannel, new WifiP2pManager.PeerListListener() {
@Override
public void onPeersAvailable(WifiP2pDeviceList peers) {
// TODO Auto-generated method stub
if (peers != null) {
if (device.deviceName.equals("ABC")) {
Log.d(tag, "found device!!! ");
Toast.makeText(getApplicationContext(), "FOUND!!", Toast.LENGTH_SHORT).show();
}
}
}
});
} else {
Log.d(tag, "mMaganger == null");
}
}
I want to get the deviceName from the list of peers so that I can found that one named "ABC". Any idea?