Cleanup executeAsync

This commit is contained in:
Martin Fietz 2018-01-09 20:13:14 +01:00
parent b1c212c2fc
commit 59a1b4a2bb
8 changed files with 8 additions and 45 deletions

View File

@ -171,11 +171,7 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity {
return null; return null;
} }
}; };
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { authTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, service);
authTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, service);
} else {
authTask.execute();
}
} }
}); });
} }

View File

@ -56,13 +56,8 @@ public class OpmlFeedQueuer extends AsyncTask<Void, Void, Void> {
return null; return null;
} }
@SuppressLint("NewApi")
public void executeAsync() { public void executeAsync() {
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { executeOnExecutor(THREAD_POOL_EXECUTOR);
executeOnExecutor(THREAD_POOL_EXECUTOR);
} else {
execute();
}
} }
} }

View File

@ -93,13 +93,8 @@ public class OpmlImportWorker extends
return exception != null; return exception != null;
} }
@SuppressLint("NewApi")
public void executeAsync() { public void executeAsync() {
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { executeOnExecutor(THREAD_POOL_EXECUTOR);
executeOnExecutor(THREAD_POOL_EXECUTOR);
} else {
execute();
}
} }
} }

View File

@ -160,10 +160,6 @@ public abstract class PodcastListFragment extends Fragment {
} }
}; };
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { loaderTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
loaderTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
loaderTask.execute();
}
} }
} }

View File

@ -135,11 +135,7 @@ public class TagListFragment extends ListFragment {
} }
} }
}; };
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
loadTask.execute();
}
} }
} }

View File

@ -55,13 +55,8 @@ public class FeedRemover extends AsyncTask<Void, Void, Void> {
dialog.show(); dialog.show();
} }
@SuppressLint("NewApi")
public void executeAsync() { public void executeAsync() {
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
execute();
}
} }
} }

View File

@ -225,12 +225,7 @@ public class FlattrClickWorker extends AsyncTask<Void, Integer, FlattrClickWorke
/** /**
* Starts the FlattrClickWorker as an AsyncTask. * Starts the FlattrClickWorker as an AsyncTask.
*/ */
@TargetApi(11)
public void executeAsync() { public void executeAsync() {
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
execute();
}
} }
} }

View File

@ -80,13 +80,8 @@ public class FlattrTokenFetcher extends AsyncTask<Void, Void, AccessToken> {
} }
} }
@SuppressLint("NewApi")
public void executeAsync() { public void executeAsync() {
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
execute();
}
} }
} }