mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-22 16:50:04 +02: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();
|
||||
builder.setDefaultColorSchemeParams(defaultColors);
|
||||
CustomTabsIntent customTabsIntent = builder.build();
|
||||
url = url.replace("HTTPS://", "https://");
|
||||
url = url.replace("HTTP://", "http://");
|
||||
try {
|
||||
customTabsIntent.launchUrl(context, Uri.parse(url));
|
||||
customTabsIntent.launchUrl(context, Uri.parse(url).normalizeScheme());
|
||||
} catch (Exception e) {
|
||||
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://")) {
|
||||
url = "http://" + url;
|
||||
}
|
||||
intent.setData(Uri.parse(url));
|
||||
intent.setData(Uri.parse(url).normalizeScheme());
|
||||
try {
|
||||
context.startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in a new issue