0
DHCP信息,我有這樣的代碼對Nexus One的Android上4.0.3工作:廣東話檢索在Android 2.2
WifiManager wifi = (WifiManager) getSystemService(WIFI_SERVICE);
DhcpInfo info = wifi.getDhcpInfo();
String s_gateway = String.valueOf(info.gateway);
String gatewayString = intToIp(Integer.parseInt(s_gateway));
Log.d("DHCP Info: ", s_gateway+"");
Log.d("DHCP Info: ", gatewayString+"");
這回我網關(PC + Connectify的)正確。
但Android 2.2上的相同代碼返回0.0.0.0。哪裏不對?