是否可以以编程方式在Android 10设备上启用wifi? [英] Is it possible to programmatically enable wifi on Android 10 devices?

查看:472
本文介绍了是否可以以编程方式在Android 10设备上启用wifi?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为不推荐使用 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 29enabledisable 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].

对于面向Build.VERSION_CODES.Q或更高版本的应用,此API始终返回false,并且无效.

For applications targeting Build.VERSION_CODES.Q or above, this API will always return false and will have no effect.

如果应用程序以较早的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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆