From e3575f6be82564f05a41475d56bdc2346a47d5c8 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 23 May 2013 14:42:20 +0400 Subject: [PATCH] execute api requests on a thread pool --- src/org/fox/ttrss/ApiRequest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/org/fox/ttrss/ApiRequest.java b/src/org/fox/ttrss/ApiRequest.java index 12aaae9f..5d2766d2 100644 --- a/src/org/fox/ttrss/ApiRequest.java +++ b/src/org/fox/ttrss/ApiRequest.java @@ -17,6 +17,7 @@ import javax.net.ssl.SSLSession; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; +import android.annotation.SuppressLint; import android.content.Context; import android.content.SharedPreferences; import android.net.ConnectivityManager; @@ -64,6 +65,15 @@ public class ApiRequest extends AsyncTask, Integer, JsonE } + @SuppressLint("NewApi") + @SuppressWarnings("unchecked") + public void execute(HashMap map) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) + super.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, map); + else + super.execute(map); + } + protected int getErrorMessage() { switch (m_lastError) { case NO_ERROR: