开关WiFi
2023-01-24 09:16:15 最后更新
//枭燚java实例_开关wifi
/.
abc()
需要申请的权限
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)
}