0
我不確定這是否是Galaxy Tab特定問題,或者如果我沒有利用WifiManager庫的某些相關方法,但我的應用程序正確報告Wifi是在啓動時禁用,但只要啓用它,即使它仍處於連接過程中,它仍將其視爲已啓用。Wifi報告爲「啓用」,即使它不是
所以,我在我等待啓用狀態
//at THIS line it claims to be WIFI_STATE_DISABLED so I turn it on with...
wifiManager.setEnabled(true);
//and at this line it reports as 3 (which according to the doc is WIFI_STATE_ENABLED, even though it clearly isn't
while(wifiManager.getWifiState() == WifiManager.WIFI_STATE_DISABLED || wifiManager.getWifiState() == WifiManager.WIFI_STATE_ENABLING){
線程,但它從來就不曾進入循環,它只是跳,即使未啓用右過去
我希望有一些其他的機制,我錯過了,或者我誤解了「啓用」是什麼意思?
你在調用'wifiManager.setEnable()'或'wifiManager.setWifiEnabled()'?請參閱:http://developer.android.com/reference/android/net/wifi/WifiManager.html#setWifiEnabled(boolean) –