Closed fernando-s97 closed 2 years ago
In Android 9, when I execute the code below 5 times , in the 5th attempt, I won't be able to connect. That's because every time I make a connection, a scan is triggered. Why's that? Is it really necessary?
WifiUtils.withContext(requireContext()) .connectWith("ssid", "pass") .setTimeout(5000) .onConnectionResult(object : ConnectionSuccessListener { override fun success() { isConnected = true Toast.makeText(activity, "Connect success!", Toast.LENGTH_SHORT) .show() } override fun failed(errorCode: ConnectionErrorCode) { Toast.makeText( activity, "Failed to connect: $errorCode", Toast.LENGTH_SHORT ).show() } }) .start()
In Android 9, when I execute the code below 5 times , in the 5th attempt, I won't be able to connect. That's because every time I make a connection, a scan is triggered. Why's that? Is it really necessary?