如何获取Wifi热点名称的历史/日志?

时间:2016-09-22 05:22:49

标签: android android-wifi wifimanager wificonfiguration personal-hotspot

我只想获得wifi热点的SSID。下面的代码片段足以获取当前的wifi热点名称,但我想要上一个。

try {
    WifiManager manager = (WifiManager) getActivity().getSystemService(Context.WIFI_SERVICE);
    Method getWifiApConfigurationMethod = manager.getClass().getMethod("getWifiApConfiguration");
    WifiConfiguration  config = (WifiConfiguration) getWifiApConfigurationMethod.invoke(manager);
    Log.e("CLIENT", "SSID:" + config.SSID);
} catch (Exception e) {
    e.printStackTrace();
}

请帮忙......

0 个答案:

没有答案