开发者

Convert List<ScanResults> to ArrayList<HashMap<String>>

开发者 https://www.devze.com 2023-02-20 15:35 出处:网络
I want to convert the Android WiFi scan results a List<ScanResults> to a List<? extends Map<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.

0

精彩评论

暂无评论...
验证码 换一张
取 消