Package com.android

Class ProgressManagerAdapter


  • public abstract class ProgressManagerAdapter
    extends java.lang.Object
    An adapter for accessing environment-dependent progress and cancellation functionality. By default all public methods of this class have no effect. See subclasses for descriptions of behavior in specific environments.
    • Constructor Detail

      • ProgressManagerAdapter

        public ProgressManagerAdapter()
    • Method Detail

      • checkCanceled

        public static void checkCanceled()
        Checks if the progress indicator associated with the current thread has been canceled and, if so, throws an unchecked exception. The exact type of the exception is environment-dependent.
      • throwIfCancellation

        public static void throwIfCancellation​(@NonNull
                                               java.lang.Throwable t)
        Rethrows the given exception if it means that the current computation was cancelled. This method is intended to be used in the following context:
             try {
                 // Code that calls ProgressManagerAdapter.checkCancelled()
             }
             catch (Exception e) {
                 ProgressManagerAdapter.throwIfCancellation(e);
                 // Handle other exceptions.
             }
         
      • doCheckCanceled

        protected abstract void doCheckCanceled()
      • doThrowIfCancellation

        protected void doThrowIfCancellation​(@NonNull
                                             java.lang.Throwable t)