Can WIFI be turned off programmatically

后端 未结 3 2182
孤城傲影
孤城傲影 2021-01-07 02:19

How can wifi be turned off/on programmatically and do is rooted or system app required for this.

3条回答
  •  滥情空心
    2021-01-07 02:58

    Yes, its possible. wifimangr.setWifiEnabled(false);

    Create an object of Wifimanager..and call the method setWifiEnabled to "false". wifimangr.setWifiEnabled(false);

    you need CHANGE_WIFI_STATE permission todo this.

提交回复
热议问题