简体   繁体   English

如何防止Wifi处于关闭状态

[英]How to prevent Wifi in off state

My network application do not want the WiFi state of device going to be off. 我的网络应用程序不希望设备的WiFi状态关闭。

As in setting page have option under advanced to select the radio as always keeping the WiFi enable as screen go off. 与设置页面一样,在高级选项下可以选择无线电,因为屏幕关闭时始终保持WiFi启用。

I want to do the same thing programmatically, even i tried at starting take the WiFi lock but as soon as screen go in off state the WiFi went into off state. 我想以编程方式做同样的事情,即使我尝试开始获取WiFi锁定,但只要屏幕进入关闭状态,WiFi就会进入关闭状态。

How to achieve programmatically to keep the WiFi active? 如何以编程方式实现使WiFi保持活动状态?

use a wifi lock of type WIFI_MODE_FULL 使用WIFI_MODE_FULL类型的wifi
or WIFI_MODE_FULL_HIGH_PERF . WIFI_MODE_FULL_HIGH_PERF

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM