Want more features on Pastebin? Sign Up, it's FREE!
Guest

Android AsyncTask Compat

By: Pauland on Nov 6th, 2012  |  syntax: Java  |  size: 0.35 KB  |  views: 103  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public abstract class AsyncTaskBase<Param, Progress, Result> extends AsyncTask<Param, Progress, Result>
  2. {
  3.  
  4.         @TargetApi(11)
  5.         public final void ExecuteCompat(Param... params)
  6.         {
  7.                 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
  8.                         this.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
  9.                 else
  10.                         this.execute(params);
  11.  
  12.         }
  13. }
clone this paste RAW Paste Data