Class DynamicTaskUtils


  • public class DynamicTaskUtils
    extends java.lang.Object
    Helper class to easily execute or cancel an AsyncTask by handling all the exceptions.
    • Constructor Detail

      • DynamicTaskUtils

        public DynamicTaskUtils()
    • Method Detail

      • executeTask

        public static void executeTask​(@Nullable
                                       android.os.AsyncTask<java.lang.Object,​?,​?> task)
        Deprecated.
        Use executeTask(DynamicTask) or standard java.util.concurrent APIs.
        Try to execute the supplied async task.
        Parameters:
        task - The async task to be executed.
        See Also:
        AsyncTask.executeOnExecutor(Executor, Object[])
      • cancelTask

        public static void cancelTask​(@Nullable
                                      android.os.AsyncTask<?,​?,​?> task)
        Deprecated.
        Use cancelTask(DynamicTask, boolean) or standard java.util.concurrent APIs.
        Try to cancel the supplied async task.
        Parameters:
        task - The async task to be cancelled.
        See Also:
        AsyncTask.cancel(boolean)
      • cancelTask

        public static void cancelTask​(@Nullable
                                      DynamicTask<?,​?,​?> task,
                                      boolean mayInterruptIfRunning)
        Try to cancel the supplied dynamic task.
        Parameters:
        task - The dynamic task to be cancelled.
        mayInterruptIfRunning - true if the thread executing the task should be interrupted; otherwise, in-progress tasks are allowed to complete.
        See Also:
        DynamicTask.cancel(boolean)