Class NetworkTypeObserver

  • @Deprecated
    public final class NetworkTypeObserver
    extends Object
    Deprecated. is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    Observer for network type changes.

    Registered listeners are informed at registration and whenever the network type changes.

    The current network type can also be queried without registration.

    • Method Detail

      • getInstance

        public static NetworkTypeObserver getInstance​(Context context)
        Returns a network type observer instance.
        context - A Context.
      • resetForTests

        public static void resetForTests()
        Resets the network type observer for tests.
      • getNetworkType

        public int getNetworkType()
        Returns the current network type.