我使用了你的项目,并添加了一个方法:onCapabilitiesChanged
。我先启用了飞行模式然后再关闭,然后重新打开。这是日志:
onAvailable 632
onCapabilitiesChanged 632 [传输:蜂窝数据 ...]
onAvailable 632
onCapabilitiesChanged 632 [传输:蜂窝数据 ...]
onAvailable 632
onCapabilitiesChanged 632 [传输:蜂窝数据 ...]
onCapabilitiesChanged 632 [传输:蜂窝数据 ...]
onCapabilitiesChanged 632 [传输:蜂窝数据 ...]
onAvailable 633
onCapabilitiesChanged 633 [传输:Wi-Fi ...] onAvailable 633
onCapabilitiesChanged 633 [传输:Wi-Fi ...]
onAvailable 633
onCapabilitiesChanged 633 [传输:Wi-Fi ...]
onCapabilitiesChanged 633 [传输:Wi-Fi ...]
onCapabilitiesChanged 633 [传输:Wi-Fi ...]
onCapabilitiesChanged 633 [传输:Wi-Fi ...]
onCapabilitiesChanged 633 [传输:Wi-Fi ...]
onCapabilitiesChanged 633 [传输:Wi-Fi ...]
onLost 632
onLost 632
onLost 632
onLost 633
onLost 633
onLost 633
onAvailable 634
onCapabilitiesChanged 634 [传输:蜂窝数据 ...]
onAvailable 634
onCapabilitiesChanged 634 [传输:蜂窝数据 ...]
onAvailable 634
onCapabilitiesChanged 634 [传输:蜂窝数据 ...]
onCapabilitiesChanged 634 [传输:蜂窝数据 ...]
onCapabilitiesChanged 634 [传输:蜂窝数据 ...]
onCapabilitiesChanged 634 [传输:蜂窝数据 ...]
onAvailable 635
onCapabilitiesChanged 635 [传输:Wi-Fi ...]
onAvailable 635
onCapabilitiesChanged 635 [传输:Wi-Fi ...]
onAvailable 635
onCapabilitiesChanged 635 [传输:Wi-Fi ...]
onCapabilitiesChanged 635 [传输:Wi-Fi ...]
onCapabilitiesChanged 635 [传输:Wi-Fi ...]
onCapabilitiesChanged 635 [传输:Wi-Fi ...]
onLost 634
onLost 634
onLost 634
onCapabilitiesChanged 635 [传输:Wi-Fi ...]
onCapabilitiesChanged 635 [传输:Wi-Fi ...]
如您所见,
LOST
是指移动网络传输,而
AVAILABLE
是指
WiFi
。
根据您的使用情况(启用 WiFi、启用移动数据、禁用 WiFi 数据、启用 WiFi、禁用 WiFi),我得到了以下结果。
onAvailable 640
onCapabilitiesChanged 640 [ Transports: WIFI ... ]
onAvailable 640
onCapabilitiesChanged 640 [ Transports: WIFI ... ]
onCapabilitiesChanged 640 [ Transports: WIFI ... ]
onCapabilitiesChanged 640 [ Transports: WIFI ... ]
onCapabilitiesChanged 640 [ Transports: WIFI ... ]
onCapabilitiesChanged 640 [ Transports: WIFI ... ]
onLost 640
onLost 640
onAvailable 641
onCapabilitiesChanged 641 [ Transports: CELLULAR ... ]
onAvailable 641
onCapabilitiesChanged 641 [ Transports: CELLULAR ... ]
onCapabilitiesChanged 641 [ Transports: CELLULAR ... ]
onCapabilitiesChanged 641 [ Transports: CELLULAR ... ]
onAvailable 642
onCapabilitiesChanged 642 [ Transports: WIFI ... ]
onAvailable 642
onCapabilitiesChanged 642 [ Transports: WIFI ... ]
onCapabilitiesChanged 642 [ Transports: WIFI ... ]
onCapabilitiesChanged 642 [ Transports: WIFI ... ]
onCapabilitiesChanged 642 [ Transports: WIFI ... ]
onCapabilitiesChanged 642 [ Transports: WIFI ... ]
onLost 641
onLost 641
onLost 642
onLost 642
onAvailable 643
onCapabilitiesChanged 643 [ Transports: CELLULAR ... ]
onAvailable 643
onCapabilitiesChanged 643 [ Transports: CELLULAR ... ]
onCapabilitiesChanged 643 [ Transports: CELLULAR ... ]
onCapabilitiesChanged 643 [ Transports: CELLULAR ... ]