我正在尝试使用之前在这里看到的代码将我的 Android 设备设置为接入点:
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiConfiguration netConfig = new WifiConfiguration();
netConfig.SSID = "MyAccessPoint";
Method method = wifi.getClass().getMethod("setWifiApEnabled", WifiConfiguration.class, boolean.class);
method.invoke(wifi, netConfig, true);
现在,我设法打开它,但没有我在 WifiConfiguration 中设置的 SSID。
这真让我抓狂。
任何人?