How to auto connect a WiFi with specified SSID?

前端 未结 2 1674
野趣味
野趣味 2021-02-09 13:35

Can some body help me to solve this issue?

Here is my code, and at mWifi.enableNetwork(netID, true) it\'s cannot enable network and cannot auto connect to

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-09 13:54

    try adding remaining information about the network such as allowed ciphers, key Mangement scheme and the PSK (if you are using one)

    Secondly check in the configured networks list first to make sure that you don't try to add another network with the same configuration as there is not point doing that.

    As a recommendation don't startScan() and wait for it finish. Register for SCAN_RESULTS_AVAILABLE_ACTION and use a callback from the broadcast receiver to your activity to process those results.

提交回复
热议问题