Class DynamicTaskUtils
- java.lang.Object
-
- com.pranavpandey.android.dynamic.util.DynamicTaskUtils
-
public class DynamicTaskUtils extends java.lang.ObjectHelper class to easily execute or cancel anAsyncTaskby 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 voidcancelTask(android.os.AsyncTask<?,?,?> task)Deprecated.UsecancelTask(DynamicTask, boolean)or standardjava.util.concurrentAPIs.static voidcancelTask(DynamicTask<?,?,?> task, boolean mayInterruptIfRunning)Try to cancel the supplied dynamic task.static voidexecuteTask(android.os.AsyncTask<java.lang.Object,?,?> task)Deprecated.UseexecuteTask(DynamicTask)or standardjava.util.concurrentAPIs.static voidexecuteTask(DynamicTask<?,?,?> task)Try to execute the supplied dynamic task.
-
-
-
Method Detail
-
executeTask
public static void executeTask(@Nullable android.os.AsyncTask<java.lang.Object,?,?> task)Deprecated.UseexecuteTask(DynamicTask)or standardjava.util.concurrentAPIs.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.UsecancelTask(DynamicTask, boolean)or standardjava.util.concurrentAPIs.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-trueif the thread executing the task should be interrupted; otherwise, in-progress tasks are allowed to complete.- See Also:
DynamicTask.cancel(boolean)
-
-