2012-08-16 124 views

回答

0

您無法在模擬器中啓用wifi。

如果你是你的基礎在谷歌電視遠程項目代碼,那麼你就可以改變這種代碼忽略了WIFI網絡:http://code.google.com/p/google-tv-remote/source/browse/src/com/google/android/apps/tvremote/DeviceFinder.java

private boolean isSimulator() { 
     return Build.FINGERPRINT.startsWith("generic"); 
    } 

    private boolean isWifiAvailable() { 
    try { 
     if (isSimulator()) { 
      return true; 
     } 
     if (!wifiManager.isWifiEnabled()) { 
      return false; 
     } 
     WifiInfo info = wifiManager.getConnectionInfo(); 
     return info != null && info.getIpAddress() != 0; 
    } catch (Exception e) { 
     Log.e(LOG_TAG, "isWifiAvailable", e); 
    } 
    return false; 
    }