Class DataSubscriptionList

  • All Implemented Interfaces:

    public class DataSubscriptionList
    extends java.lang.Object
    implements DataSubscription
    Tracks any number of DataSubscription objects, which can be canceled with a single cancel() call. This is typically used in live cycle components like Android's Activity:
    • Constructor Detail

      • DataSubscriptionList

        public DataSubscriptionList()
    • Method Detail

      • add

        public void add​(DataSubscription subscription)
        Add the given subscription to the list of tracked subscriptions. Clears any previous "canceled" state.
      • cancel

        public void cancel()
        Cancels all tracked subscriptions and removes all references to them.
        Specified by:
        cancel in interface DataSubscription
      • getActiveSubscriptionCount

        public int getActiveSubscriptionCount()
        Returns number of active (added) subscriptions (resets to 0 after cancel()).