问题描述
问候大家!我得到相当厌倦了Android的ConnectivityManager类。我一直试图保持5小时,获得requestRouteToHost工作。我在模拟器上运行我的code,但requestRouteToHost总是失败。我知道我有连接,因为我叫getActiveNetworkInfo()和它相连。我已经添加了ACCESS_NETWORK_STATE和CHANGE_NETWORK_STATE权限无济于事。任何提示将不胜AP preciated。
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 code on the emulator but the requestRouteToHost always fails. I know I have connectivity because I called getActiveNetworkInfo() and it was connected. I've added the ACCESS_NETWORK_STATE and CHANGE_NETWORK_STATE permissions to no avail. Any tips would be greatly appreciated.
编辑--------该方法InetAddress.isReachable失败也是如此。我用的是主机名java.sun.com如在文档中指定。我认为这是与模拟器有问题。山姆
EDIT--------The method InetAddress.isReachable fails as well. I was using the hostname java.sun.com as specified in the docs. I think this is a problem with the emulator.Sam
推荐答案
看起来requestRouteToHost()不支持WiFi实现。 WifiStateTracker私有类没有requestRouteToHost()实现。相反,从基类NetworkStateTracker默认实现始终返回false。
Looks like requestRouteToHost() is not implemented for WiFi. WifiStateTracker private class does not have requestRouteToHost() implementation. Instead, default implementation from base class NetworkStateTracker always returns false.
这篇关于requestRouteToHost机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!