Skip to content

Instantly share code, notes, and snippets.

@mypplication
Created July 11, 2013 20:45
Show Gist options
  • Save mypplication/5979085 to your computer and use it in GitHub Desktop.
Save mypplication/5979085 to your computer and use it in GitHub Desktop.
Class AsyncTask for all android version
public abstract class AsyncTaskBase<Param, Progress, Result> extends AsyncTask<Param, Progress, Result>
{
@TargetApi(11)
public final void executeCompat(Param... params)
{
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
this.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
else
this.execute(params);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment