Abhishek choudhary
Abhishek choudhary

Reputation: 209

WIFI P2P discovery list is not getting refreshed?

I am working on an application where i listed all the WIFI P2P nearby devices in a list. But the problem is that it is showing that device also which wifi is disable now. It is able to detect new devices and can list in listview but not able to remove the old ones. Thanks in advance.

Upvotes: 0

Views: 510

Answers (2)

Ravindra-Ravi Verma
Ravindra-Ravi Verma

Reputation: 535

it will remove the old one after one second as android system define by default value of 60000 milisecond to refresh the wifi direct peer and there is no way to set the same.check android os code

Upvotes: 0

user3404558
user3404558

Reputation:

In the BrodcastReceiver inside WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION matching action call requestpeers() method and dont call inside anyother match.....also use peers.clear() [that may be ur arraylist of adapter]. before calling requestpeers().

Upvotes: 1

Related Questions