requestRouteToHost android

前端 未结 3 473
南方客
南方客 2021-01-28 02:05

Greetings everyone! I\'m getting rather fed up with android\'s ConnectivityManager class. I\'ve been trying for 5 hours to get the requestRouteToHost to work. I\'m running my co

3条回答
  •  后悔当初
    2021-01-28 02:25

    I would recommend testing requestRouteToHost() with a real host. Not only am I unconvinced that localhost as a name is necessarily recognized on Android, it's going to be the device/emulator itself, which would go out via neither WiFi nor 3G, so I would expect requestRouteToHost() to fail.

    You might also have a problem with wherever you are getting lookupHost() from. For example, I am not sure if this implementation supports localhost.

提交回复
热议问题