Code example for WifiP2pDeviceList

Methods: getDeviceList

0
        if (progressDialog != null && progressDialog.isShowing()) {
            progressDialog.dismiss();
        } 
         
        peers.clear();
        peers.addAll(peerList.getDeviceList());
        ((WiFiPeerListAdapter) getListAdapter()).notifyDataSetChanged();
         
        if (peers.size() == 0) {
            Lg.d("No devices found"); 
            return; 
        } 
 
    } 
 
    public void clearPeers() { 
        peers.clear();
        ((WiFiPeerListAdapter) getListAdapter()).notifyDataSetChanged();
    } 
 
Connect your IDE to all the code out there  Get Codota for Java