Android Scan for Wifi networks

前端 未结 5 710
北荒
北荒 2021-02-02 04:33

I\'m trying to scan for wireless networks and found this helpful source on the net. Unfortunately it\'s not working and I have no idea why. My problem is that I can\'t wait 10 m

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-02 05:17

    you need to implement a BroadcastReceiver listening for the scan results returned from WifiManager.startScan(). onReceive() allows you to access the scan resuls directly. it takes about 1 second for the scan to complete and trigger onReceive()...

提交回复
热议问题