# 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 Type
  Method
  Description
  `void`
  `onNetworkTypeChanged(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 of `NetworkManager.NETWORK_TYPE_*`
    - `newType`: one of `NetworkManager.NETWORK_TYPE_*`
    - `vpnActive`: `true` if the platform reports a VPN tunnel on top of the active network. May be `false` on platforms where VPN detection is unsupported (see `NetworkManager.isVPNDetectionSupported()`).