我只想获得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();
}
请帮忙......