WifiManager.getScanResults() - clarifications (automatic scans, sleep etc)

两盒软妹~` 提交于 2019-11-29 12:45:28

When wireless is disabled

  1. getScanResults() will return null...
  2. ...even after a reboot (that's to be expected - this would be disputed if it did not return null in the first place)

When wireless is enabled

2.Surprisingly enough getScanResults() will return null after some time (on a Nexus One, Android 2.3.7, Cyanogen mod - but I suspect this is not really relevant). So yes, apparently one has to initiate a scan irrespective of the wireless status

I guess this is true also if the state is WIFI_STATE_DISABLING

I am still interested in the answer in the case wireless is enabled - in particular question 2, if the device is asleep. Google groups won't let me post (hint)

LarryLiu

public List getScanResults ()

Added in API LEVEL 1

Return the results of the latest access point scan.

Returns the list of access points found in the most recent scan. An app must hold ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission in order to get valid results.

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