Android模拟(simulator)把它自己作为了localhost,也就是说,代码中使用 localhost或者127.0.0.1来访问,都是访问模拟器自己!
如果你想在模拟器simulator上面访问你的电脑,那么就使用android内置的IP 10.0.2.2。即“http://10.0.2.2:xxxx/Default.aspx”。
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3