aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-10-14 12:05:17 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-10-14 12:05:17 +0000
commit6b49a8f8e107b532465f8f1e9425abdd2a2ab8ec (patch)
treef8a6997a8daf6bbbf9b7a964ee16a02acf048b0c /app
parentab56b26333fee5e9a07f3e69b59111b9b1912672 (diff)
downloadinfinity-for-reddit-6b49a8f8e107b532465f8f1e9425abdd2a2ab8ec.tar
infinity-for-reddit-6b49a8f8e107b532465f8f1e9425abdd2a2ab8ec.tar.gz
infinity-for-reddit-6b49a8f8e107b532465f8f1e9425abdd2a2ab8ec.tar.bz2
infinity-for-reddit-6b49a8f8e107b532465f8f1e9425abdd2a2ab8ec.tar.lz
infinity-for-reddit-6b49a8f8e107b532465f8f1e9425abdd2a2ab8ec.tar.xz
infinity-for-reddit-6b49a8f8e107b532465f8f1e9425abdd2a2ab8ec.tar.zst
infinity-for-reddit-6b49a8f8e107b532465f8f1e9425abdd2a2ab8ec.zip
Fixed some links cannot be opened in this app but it is still present in app chooser.
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java6
1 files changed, 6 insertions, 0 deletions
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);