Old results from Android wifi.getScanResults ()

On my Droid 2, wifi.getScanResults () seems to return the old values ​​in a short time.

This means that while I'm at home, wifi.getScanResults () will show my home network. If I walk a few miles down the street, wifi.getScanResults () will still show my home network for the first 1 or 2 attempts. On the third attempt, my home network disappeared.

Question: Is there a way to get only the latest wifi.getScanResults ()?

Possible options:

  • If the ScanResult level is equal. minimum, suppose he is missing an assortment.
  • Somehow clean up ScanResults
    using the undocumented API.

I have a code like this:

context.registerReceiver(this, new IntentFilter(
            WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
wifi.startScan();

...

if (intent.getAction().equalsIgnoreCase(
            WifiManager.SCAN_RESULTS_AVAILABLE_ACTION))
        {
            List<ScanResult> results = wifi.getScanResults();
        }
+3
source share
2 answers

, , - WiFi , :

wifi.setWifiEnabled(false);
wifi.setWifiEnabled(true);

, ( ).

+3
+1

All Articles