Package zendesk.core

Interface NetworkInfoProvider



  • public interface NetworkInfoProvider
    A provider which will provide information about network connectivity. It must be registered (using the NetworkInfoProvider.register() method) to begin listening for network changes, and unregistering (using the NetworkInfoProvider.unregister() method) will stop it from receiving any more network changes. No changes will be received before the NetworkInfoProvider.register() method has been called, or after the NetworkInfoProvider.unregister() method has been called. It provides a simple synchronous method, isNetworkAvailable, which returns a boolean, as well as an interface for adding NetworkAware listeners to be notified when the network state changes. It also allows for adding RetryAction objects, which will be next time a network becomes available.
    • Method Detail

      • register

        void register()
        Begin listening for network change events.
      • unregister

        void unregister()
        Stop listening for network change events.
      • isNetworkAvailable

        boolean isNetworkAvailable()
        Returns whether or not the network is currently available.
        Returns:
        true if the network is currently available, false if not.
      • removeNetworkAwareListener

        void removeNetworkAwareListener(java.lang.Integer id)
        Remove a NetworkAware listener object so that it will no longer receive updates to network state.
        Parameters:
        id - the ID for the NetworkAware listener object to stop notifying.
      • removeRetryAction

        void removeRetryAction(java.lang.Integer id)
        Remove a RetryAction so that it will not be invoked next time the provider is notified with network availability.
        Parameters:
        id - the ID for the RetryAction to remove.
      • clearRetryActions

        void clearRetryActions()
        Clear all added RetryAction objects. Any RetryAction listeners previously added will no longer be invoked after this method has been called, unless they are added again via