diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2015-01-08 13:57:37 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2015-01-08 13:57:37 +0100 |
commit | f467d3ecccecfc5f1ef68c6f6da660f209e43b2a (patch) | |
tree | 57e1b163c3708c66558e3d71fe3cc8ac16883815 /app | |
parent | b89b92e6ca609190ae2bde2e1651315a2841c8c3 (diff) | |
download | AntennaPod-f467d3ecccecfc5f1ef68c6f6da660f209e43b2a.zip |
Fixed URL handling in ItemFragment
Open external activity instead of loading it inside the app
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index b2cdcb63c..ac9e744ed 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -1,6 +1,7 @@ package de.danoeh.antennapod.fragment; import android.annotation.TargetApi; +import android.content.ActivityNotFoundException; import android.content.Intent; import android.content.res.TypedArray; import android.net.Uri; @@ -181,7 +182,20 @@ public class ItemFragment extends Fragment implements LoaderManager.LoaderCallba webvDescription.getSettings().setLayoutAlgorithm( WebSettings.LayoutAlgorithm.NARROW_COLUMNS); webvDescription.getSettings().setLoadWithOverviewMode(true); - webvDescription.setWebViewClient(new WebViewClient()); + webvDescription.setWebViewClient(new WebViewClient() { + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); + try { + startActivity(intent); + } catch (ActivityNotFoundException e) { + e.printStackTrace(); + return true; + } + return true; + } + }); imgvCover = (ImageView) header.findViewById(R.id.imgvCover); progbarDownload = (ProgressBar) header.findViewById(R.id.progbarDownload); |