Package com.android
Class ProgressManagerAdapter
- java.lang.Object
-
- com.android.ProgressManagerAdapter
-
public abstract class ProgressManagerAdapter extends java.lang.ObjectAn 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 Summary
Constructors Constructor Description ProgressManagerAdapter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static voidcheckCanceled()Checks if the progress indicator associated with the current thread has been canceled and, if so, throws an unchecked exception.protected abstract voiddoCheckCanceled()protected voiddoThrowIfCancellation(java.lang.Throwable t)protected static voidsetInstance(ProgressManagerAdapter instance)static voidthrowIfCancellation(java.lang.Throwable t)Rethrows the given exception if it means that the current computation was cancelled.
-
-
-
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)
-
setInstance
protected static void setInstance(@NonNull ProgressManagerAdapter instance)
-
-