问题描述
因为不推荐使用 setWifiEnabled 在Android 10上,如何以编程方式在Android 10设备上启用wifi?
Since setWifiEnabled is deprecated on Android 10, how does one programatically enable wifi on Android 10 devices?
是否无法在Android 10+(SDK 29)上以编程方式完全启用wifi?
Is it not possible to programmatically enable wifi at all on Android 10+ (SDK 29) ?
推荐答案
否,无法通过Android-10
API level 29
从enable
或disable
Wi-Fi programmatically
[提供了替代解决方案].
No, This is not possible to enable
or disable
Wi-Fi programmatically
from Android-10
API level 29
[Until google provides an alternative solution].
如果应用程序以较早的SDK(Build.VERSION_CODES.P或更低版本)为目标,则它们可以继续使用此API.
If apps are targeting an older SDK ( Build.VERSION_CODES.P or below), they can continue to use this API.
google issuetracker
论坛中已经创建了一个问题128554616 .您可以在此处看到任何更新的信息.
There is an issue 128554616 which already has been created in google issuetracker
forum. You can see there for any updated info.
这篇关于是否可以以编程方式在Android 10设备上启用wifi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!