Skip to content

Commit

Permalink
Fixed problem with webview on ICS
Browse files Browse the repository at this point in the history
  • Loading branch information
danieloeh committed Nov 28, 2012
1 parent 2d6445e commit 35e65ef
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.content.res.TypedArray;
import android.database.Cursor;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.util.TypedValue;
Expand Down Expand Up @@ -48,13 +49,19 @@ public static ItemDescriptionFragment newInstance(FeedItem item) {
return f;
}

@SuppressLint("NewApi")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
if (AppConfig.DEBUG)
Log.d(TAG, "Creating view");
webvDescription = new WebView(getActivity());

if (PodcastApp.getThemeResourceId() == 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(0);
}
webvDescription.getSettings().setUseWideViewPort(false);
Expand Down Expand Up @@ -99,7 +106,6 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (AppConfig.DEBUG)
Log.d(TAG, "Creating fragment");
setRetainInstance(true);
FeedManager manager = FeedManager.getInstance();
Bundle args = getArguments();
long feedId = args.getLong(ARG_FEED_ID, -1);
Expand Down Expand Up @@ -131,7 +137,7 @@ public void onCompletion(String[] result) {
descriptionRef = result[0];
contentEncodedRef = result[1];
}

startLoader();
}
});
Expand Down

0 comments on commit 35e65ef

Please sign in to comment.