mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-07-07 20:30:28 +03:00
Fix an issue when opening URLs
This commit is contained in:
parent
c43fe177b5
commit
dd83e86382
1 changed files with 2 additions and 4 deletions
|
@ -669,10 +669,8 @@ public class Helper {
|
||||||
.build();
|
.build();
|
||||||
builder.setDefaultColorSchemeParams(defaultColors);
|
builder.setDefaultColorSchemeParams(defaultColors);
|
||||||
CustomTabsIntent customTabsIntent = builder.build();
|
CustomTabsIntent customTabsIntent = builder.build();
|
||||||
url = url.replace("HTTPS://", "https://");
|
|
||||||
url = url.replace("HTTP://", "http://");
|
|
||||||
try {
|
try {
|
||||||
customTabsIntent.launchUrl(context, Uri.parse(url));
|
customTabsIntent.launchUrl(context, Uri.parse(url).normalizeScheme());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
@ -683,7 +681,7 @@ public class Helper {
|
||||||
if (!url.toLowerCase().startsWith("http://") && !url.toLowerCase().startsWith("https://") && !url.toLowerCase().startsWith("gemini://")) {
|
if (!url.toLowerCase().startsWith("http://") && !url.toLowerCase().startsWith("https://") && !url.toLowerCase().startsWith("gemini://")) {
|
||||||
url = "http://" + url;
|
url = "http://" + url;
|
||||||
}
|
}
|
||||||
intent.setData(Uri.parse(url));
|
intent.setData(Uri.parse(url).normalizeScheme());
|
||||||
try {
|
try {
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in a new issue