aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app/src/main/AndroidManifest.xml9
-rw-r--r--app/src/main/java/CustomView/CustomMarkwonView.java7
2 files changed, 14 insertions, 2 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c9493e9a..425e1269 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -38,6 +38,15 @@
<data
android:host="www.reddit.com"
android:scheme="https" />
+ <data
+ android:host="reddit.com"
+ android:scheme="https" />
+ <data
+ android:host="amp.reddit.com"
+ android:scheme="https" />
+ <data
+ android:host="m.reddit.com"
+ android:scheme="https" />
</intent-filter>
</activity>
<activity
diff --git a/app/src/main/java/CustomView/CustomMarkwonView.java b/app/src/main/java/CustomView/CustomMarkwonView.java
index 50ac4bbf..05c2e2fa 100644
--- a/app/src/main/java/CustomView/CustomMarkwonView.java
+++ b/app/src/main/java/CustomView/CustomMarkwonView.java
@@ -40,8 +40,11 @@ public class CustomMarkwonView extends MarkwonView {
builder.addDefaultShareMenuItem();
builder.setToolbarColor(context.getResources().getColor(R.color.colorPrimary));
CustomTabsIntent customTabsIntent = builder.build();
- customTabsIntent.intent.setPackage(context.getPackageName());
- customTabsIntent.launchUrl(context, Uri.parse(link));
+ Uri uri = Uri.parse(link);
+ if(uri.getHost() != null && uri.getHost().equals("www.reddit.com")) {
+ customTabsIntent.intent.setPackage(context.getPackageName());
+ }
+ customTabsIntent.launchUrl(context, uri);
}
}).build();