From 9f9ddad685e4291376fca35b420c07475571b789 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Wed, 20 Jan 2016 01:49:15 +0100 Subject: [PATCH] Prevent WebView segfault --- .../antennapod/fragment/ItemDescriptionFragment.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index 6c9473176..f270dc22d 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -112,11 +112,10 @@ public class ItemDescriptionFragment extends Fragment implements AudioplayerCont Bundle savedInstanceState) { Log.d(TAG, "Creating view"); webvDescription = new WebView(getActivity()); + if (Build.VERSION.SDK_INT >= 11) { + webvDescription.setLayerType(View.LAYER_TYPE_SOFTWARE, null); + } if (UserPreferences.getTheme() == R.style.Theme_AntennaPod_Dark) { - if (Build.VERSION.SDK_INT >= 11 - && Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { - webvDescription.setLayerType(View.LAYER_TYPE_SOFTWARE, null); - } webvDescription.setBackgroundColor(getResources().getColor(R.color.black)); } webvDescription.getSettings().setUseWideViewPort(false);