Interface NetworkTypeListener
public interface NetworkTypeListener
Receives notifications when the device's active network changes type
(WiFi <-> Cellular <-> Ethernet <-> None <-> VPN). Register with
NetworkManager.addNetworkTypeListener(NetworkTypeListener).
Implementations are invoked on the EDT.
-
Method Summary
Modifier and TypeMethodDescriptionvoidonNetworkTypeChanged(int oldType, int newType, boolean vpnActive) Called when the platform transitions between network classes.
-
Method Details
-
onNetworkTypeChanged
void onNetworkTypeChanged(int oldType, int newType, boolean vpnActive) Called when the platform transitions between network classes.
Parameters
oldType: one ofNetworkManager.NETWORK_TYPE_*newType: one ofNetworkManager.NETWORK_TYPE_*vpnActive:trueif the platform reports a VPN tunnel on top of the active network. May befalseon platforms where VPN detection is unsupported (seeNetworkManager.isVPNDetectionSupported()).
-