From 6b49a8f8e107b532465f8f1e9425abdd2a2ab8ec Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 14 Oct 2019 20:05:17 +0800 Subject: Fixed some links cannot be opened in this app but it is still present in app chooser. --- .../infinityforreddit/Activity/LinkResolverActivity.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/src') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java index b85d14f2..8a2dfb89 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java @@ -149,6 +149,12 @@ public class LinkResolverActivity extends AppCompatActivity { } private void deepLinkError(Uri uri) { + String authority = uri.getAuthority(); + if(authority != null && (authority.contains("reddit.com") || authority.contains("redd.it") || authority.contains("reddit.app.link"))) { + openInCustomTabs(uri, getPackageManager()); + return; + } + Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(uri); -- cgit v1.2.3