获取WiFi状态
2023-01-24 09:16:15 最后更新
 说明:
若wifi打开则关闭,wifi关闭则打开
需要申请的权限
android.permission.ACCESS_WIFI_STATE
android.permission.CHANGE_WIFI_STATE
android.permission.WAKE_LOCK
./
java(wmr, activity, "android.app.Activity.getSystemService", "String", "wifi")
java(iswed, wmr, "android.net.wifi.WifiManager.isWifiEnabled")
//isweb true为开启 false为关闭
f(iswed)
{
java(c, wmr, "android.net.wifi.WifiManager.setWifiEnabled", "boolean", false)
}
else
{
java(c, wmr, "android.net.wifi.WifiManager.setWifiEnabled", "boolean", true)
}