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

后端 未结 3 785
忘掉有多难
忘掉有多难 2020-12-18 11:04

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

Is it not possible to programmatically enable wifi

3条回答
  •  Happy的楠姐
    2020-12-18 11:53

    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.

提交回复
热议问题