Class DynamicTaskUtils
- java.lang.Object
-
- com.pranavpandey.android.dynamic.util.DynamicTaskUtils
-
public class DynamicTaskUtils extends java.lang.Object
Helper class to easily execute or cancel anAsyncTask
by handling all the exceptions.
-
-
Constructor Summary
Constructors Constructor Description DynamicTaskUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
cancelTask(AsyncTask<?,?,?> task)
Deprecated.UsecancelTask(DynamicTask, boolean)
or standardjava.util.concurrent
APIs.static void
cancelTask(DynamicTask<?,?,?> task, boolean mayInterruptIfRunning)
Try to cancel the supplied dynamic task.static void
executeTask(AsyncTask<java.lang.Object,?,?> task)
Deprecated.UseexecuteTask(DynamicTask)
or standardjava.util.concurrent
APIs.static void
executeTask(DynamicTask<?,?,?> task)
Try to execute the supplied dynamic task.
-
-
-
Method Detail
-
executeTask
public static void executeTask(@Nullable AsyncTask<java.lang.Object,?,?> task)
Deprecated.UseexecuteTask(DynamicTask)
or standardjava.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 AsyncTask<?,?,?> task)
Deprecated.UsecancelTask(DynamicTask, boolean)
or standardjava.util.concurrent
APIs.Try to cancel the supplied async task.- Parameters:
task
- The async task to be cancelled.- See Also:
AsyncTask.cancel(boolean)
-
executeTask
public static void executeTask(@Nullable DynamicTask<?,?,?> task)
Try to execute the supplied dynamic task.- Parameters:
task
- The dynamic task to be executed.- See Also:
DynamicTask.executeOnExecutor(Executor)
-
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)
-
-