diff options
Diffstat (limited to 'src/de/danoeh/antennapod/fragment')
-rw-r--r-- | src/de/danoeh/antennapod/fragment/FeedlistFragment.java | 7 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java | 17 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/de/danoeh/antennapod/fragment/FeedlistFragment.java b/src/de/danoeh/antennapod/fragment/FeedlistFragment.java index bb96ff4b1..b296293ce 100644 --- a/src/de/danoeh/antennapod/fragment/FeedlistFragment.java +++ b/src/de/danoeh/antennapod/fragment/FeedlistFragment.java @@ -8,6 +8,7 @@ import de.danoeh.antennapod.service.DownloadService; import de.danoeh.antennapod.storage.DownloadRequester; import de.danoeh.antennapod.util.FeedMenuHandler; import de.danoeh.antennapod.R; +import android.os.AsyncTask; import android.os.Bundle; import android.app.Activity; import android.view.View; @@ -163,7 +164,11 @@ public class FeedlistFragment extends SherlockListFragment implements fla.notifyDataSetChanged(); } }; - remover.execute(selectedFeed); + if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { + remover.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, selectedFeed); + } else { + remover.execute(selectedFeed); + } break; } } diff --git a/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index 2e13b5ba0..4cd2902d2 100644 --- a/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -5,6 +5,7 @@ import java.net.URLEncoder; import org.apache.commons.lang3.StringEscapeUtils; +import android.annotation.SuppressLint; import android.app.Activity; import android.os.AsyncTask; import android.os.Bundle; @@ -36,7 +37,8 @@ public class ItemDescriptionFragment extends SherlockFragment { private AsyncTask<Void, Void, Void> webViewLoader; - public static ItemDescriptionFragment newInstance(FeedItem item, boolean scrollbarEnabled) { + public static ItemDescriptionFragment newInstance(FeedItem item, + boolean scrollbarEnabled) { ItemDescriptionFragment f = new ItemDescriptionFragment(); Bundle args = new Bundle(); args.putLong(ARG_FEED_ID, item.getFeed().getId()); @@ -54,12 +56,17 @@ public class ItemDescriptionFragment extends SherlockFragment { return webvDescription; } + @SuppressLint("NewApi") @Override public void onAttach(Activity activity) { super.onAttach(activity); if (webViewLoader == null && item != null) { webViewLoader = createLoader(); - webViewLoader.execute(); + if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { + webViewLoader.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + } else { + webViewLoader.execute(); + } } } @@ -91,7 +98,11 @@ public class ItemDescriptionFragment extends SherlockFragment { Feed feed = manager.getFeed(feedId); item = manager.getFeedItem(itemId, feed); webViewLoader = createLoader(); - webViewLoader.execute(); + if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { + webViewLoader.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + } else { + webViewLoader.execute(); + } } else { Log.e(TAG, TAG + " was called with invalid arguments"); } |