Add parameters to AsyncTaskHelper, remove unused method

This commit is contained in:
Daniel Schaal 2015-09-27 09:53:25 +02:00
parent 9447e563a5
commit 76e693c40e

View file

@ -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