Add parameters to AsyncTaskHelper, remove unused method
This commit is contained in:
parent
9447e563a5
commit
76e693c40e
1 changed files with 1 additions and 9 deletions
|
@ -7,16 +7,8 @@ import android.os.Build;
|
||||||
* Created by David on 20.07.2015.
|
* Created by David on 20.07.2015.
|
||||||
*/
|
*/
|
||||||
public class AsyncTaskHelper {
|
public class AsyncTaskHelper {
|
||||||
|
|
||||||
public static <T> void StartAsyncTask(AsyncTask asyncTask, T... params) {
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
|
|
||||||
asyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
|
|
||||||
else
|
|
||||||
asyncTask.execute(params);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SafeVarargs
|
@SafeVarargs
|
||||||
public static <T> void StartAsyncTask(AsyncTask asyncTask, Void... params) {
|
public static <Params,Progress,Result> void StartAsyncTask(AsyncTask<Params,Progress,Result> asyncTask, Params... params) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
|
||||||
asyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
|
asyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue