Convert List<ScanResults> to ArrayList<HashMap<String>>
I want to convert the Android WiFi scan results a List<ScanResults> to a List<? extends Map<String, ?>>
This is开发者_JAVA技巧 for use with the SimpleAdapter which I would like to use
I have tried converting scans to a String[] for each BSSID and SSID then adding them to an ArrayList with a loop, but was unable to do with without overriding each as I went.
I put the scan result into a hash map. Here is what I did.
List<ScanResult> results = wifiMgr.getScanResults();
rssiList = new HashMap<String, Integer>();
for (ScanResult result : results) {
rssiList.put(result.BSSID, result.level);
}
Hope this helps.
加载中,请稍侯......
精彩评论