我需要讓我的應用程序等待無線連接完全建立,然後才能繼續運行。 我有這樣的代碼現在:等待網絡連接
wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
if(!wifiManager.isWifiEnabled())
{
Toast.makeText(this, "Connecting to wifi network", Toast.LENGTH_SHORT).show();
wifiManager.setWifiEnabled(true);
//wait for connection to be establisihed and only then proceed
}
[如何檢測何時在Android中建立WIFI連接?](http://stackoverflow.com/questions/5888502/how-to-detect-when-wifi-connection-has-been-established -in-android) – naXa