WIFI P2P discovery list is not getting refreshed?

南楼画角 提交于 2019-12-12 06:31:42

问题


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.


回答1:


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().




回答2:


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



来源:https://stackoverflow.com/questions/22298581/wifi-p2p-discovery-list-is-not-getting-refreshed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!