Is it possible to programatically enable wifi on Android 10 devices?

北城以北 提交于 2019-12-01 07:28:58

问题


Since setWifiEnabled is deprecated on Android 10, how does one programatically enable wifi on Android 10 devices?

Is it not possible to programatically enable wifi at all on Android 10+ (SDK 29) ?


回答1:


No, This is not possible to enable or disable Wi-Fi programmatically from Android-10 API level 29 [Until google provides an alternative solution].

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

If apps are targeting an older SDK ( Build.VERSION_CODES.P or below), they can continue to use this API.

There is an issue 128554616 which already has been created in google issuetracker forum. You can see there for any updated info.



来源:https://stackoverflow.com/questions/58075918/is-it-possible-to-programatically-enable-wifi-on-android-10-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!